标签:python错误
在进行图像处理时可能会用到的包:pillowapt-get install libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev python-dev
在执行此命令时可能会遇到找不到包的问题,是因为更换源的原因,我是将源更换为了阿里的镜像,虽然速度变快了,但是会遇到找不到安装包的错误,此时的处理方法是将镜像源换回原来的,执行以下命令:
mv /etc/apt/sources.list{,.bak}
vim /etc/apt/sources.list
在打开的编辑器中输入以下网址:
deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
然后保存退出并执行以下命令更新:
apt-get update
更新完成之后,再次执行命令:
apt-get install libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev python-dev
最后执行命令安装pillow即可:
pip install pillow
标签:python错误
原文地址:http://blog.51cto.com/11142243/2093806