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,一路安装完成

相关文章

Python3实现二叉树的最大深度

Python3实现二叉树的最大深度

问题提出: 给定一个二叉树,找出其最大深度。二叉树的深度为根节点到最远叶子节点的最长路径上的节点数。 说明: 叶子节点是指没有子节点的节点。 解决思路:递归法求解。从根结点向下遍历,...

Python标准库defaultdict模块使用示例

Python标准库中collections对集合类型的数据结构进行了很多拓展操作,这些操作在我们使用集合的时候会带来很多的便利,多看看很有好处。 defaultdict是其中一个方法,就...

python交互模式下输入换行/输入多行命令的方法

先给大家介绍下python交互模式下输入换行/输入多行命令的方法 换行方法 \ 如: >>> print 'aaa'; \  ... print 'bbb'...

python绘制圆柱体的方法

python绘制圆柱体的方法

本文实例为大家分享了python绘制圆柱体示的具体代码,供大家参考,具体内容如下 #!/usr/bin/env python import vtk # 参考的C++版本源码及解释...

python文件操作之目录遍历实例分析

本文实例讲述了python文件操作之目录遍历的方法。分享给大家供大家参考。具体分析如下: Python的os模块,包含了普遍的操作系统功能,这里主要学习与路径相关的函数: os.list...