Python安装Imaging报错:The _imaging C module is not installed问题解决方法

yipeiwu_com5年前Python基础

今天写Python程序上传图片需要用到PIL库,于是到http://www.pythonware.com/products/pil/#pil117下载了一个1.1.7版本的,我用的是CentOS64 并且自行升级后的Python版本安装PIL库
首先下载解压:

复制代码 代码如下:

[root@lee ~]# wget http://www.pythonware.com/products/pil/#pil117
[root@lee ~]# tar -xf Imaging-1.1.7.tar.gz

然后准备安装
复制代码 代码如下:

[root@lee ~]# cd Imaging-1.1.7
[root@lee Imaging-1.1.7]# python python setup.py build_ext -i

都没问题,当测试安装的时候却老提示:*** The _imaging C module is not installed
复制代码 代码如下:

[root@lee Imaging-1.1.7]# python selftest.py
*** The _imaging C module is not installed

找了半天,也找不出是什么原因,后来终于在官网从一堆英文中找到了关键所在,解决方法,实际根据自己的python PIL路径设置
复制代码 代码如下:

[root@lee Imaging-1.1.7]# echo '/usr/local/lib/python2.7/site-packages/PIL' >> /etc/ld.so.conf
[root@lee Imaging-1.1.7]# ldconfig

重新python selftest.py,一路安装完成

相关文章

详解python 利用echarts画地图(热力图)(世界地图,省市地图,区县地图)

详解python 利用echarts画地图(热力图)(世界地图,省市地图,区县地图)

首先安装对应的python模块 $ pip install pyecharts==0.5.10 $ pip install echarts-countries-pypkg $ pip...

python3实现高效的端口扫描

我们通过python-nmap实现一个高效的端口扫描工具,与定时作业crontab及邮件告警结合,可以很好的帮助我们及时发现异常开放的高危端口。当然,该工具也可以作为业务服务端口的可用性...

python实现连续变量最优分箱详解--CART算法

关于变量分箱主要分为两大类:有监督型和无监督型 对应的分箱方法: A. 无监督:(1) 等宽 (2) 等频 (3) 聚类 B. 有监督:(1) 卡方分箱法(ChiMerge) (2) I...

Python3实现发送邮件和发送短信验证码功能

Python3实现发送邮件和发送短信验证码功能

 Python3实现发送邮件: import smtplib from email.mime.text import MIMEText from email.utils i...

Python Pickle 实现在同一个文件中序列化多个对象

也是看别人代码才知道可以打开一个文件就可以把多个对象序列化到这个文件中。 with open('../raw_data/remap.pkl', 'wb') as f: pickle...