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

yipeiwu_com6年前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中unittest用法实例

本文实例讲述了Python中unittest的用法,分享给大家供大家参考。具体用法分析如下: 1. unittest module包含了编写运行unittest的功能,自定义的test...

深入理解Python3 内置函数大全

深入理解Python3 内置函数大全

本文主要介绍了Python3 内置函数,分享给大家,具体如下: 内置函数 以下代码以Python3.6.1为例 #coding=utf-8 # builtin_function....

python面向对象法实现图书管理系统

python面向对象法实现图书管理系统

本文实例为大家分享了python实现图书管理系统的具体代码,供大家参考,具体内容如下 需求: 图书管理系统 1.查询图书 2.增加图书 3.借阅图书 4.归还图书 5.退出系统 书:...

Python分析学校四六级过关情况

Python分析学校四六级过关情况

这段时间看了数据分析方面的内容,对Python中的numpy和pandas有了最基础的了解。我知道如果我不用这些技能做些什么的话,很快我就会忘记。想起之前群里发过一个学校的四六级成绩表,...

浅析Python 3 字符串中的 STR 和 Bytes 有什么区别

浅析Python 3 字符串中的 STR 和 Bytes 有什么区别

Python2的字符串有两种:str和Unicode,Python3的字符串也有两种:str和Bytes。Python2的str相当于Python3的Bytes,而Unicode相当于P...