码迷,mamicode.com
首页 > 编程语言 > 详细

python安装pillow时出错(ubuntu)

时间:2018-04-02 16:00:25      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:python错误

在进行图像处理时可能会用到的包:pillow
在安装时可能会遇到的错误信息中包含setuptools等关键字,此时需要执行一下命令来安装基本环境:

apt-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安装pillow时出错(ubuntu)

标签:python错误

原文地址:http://blog.51cto.com/11142243/2093806

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!