发布于 2014-08-26 13:45:33 | 613 次阅读 | 评论: 1 | 来源: 网友投递

这里有新鲜出炉的Python3 Cookbook中文版,程序狗速度看过来!

Python编程语言

Python 是一种面向对象、解释型计算机程序设计语言,由Guido van Rossum于1989年底发明,第一个公开发行版发行于1991年。Python语法简洁而清晰,具有丰富和强大的类库。它常被昵称为胶水语言,它能够把用其他语言制作的各种模块(尤其是C/C++)很轻松地联结在一起。


本文讲解了Python安装Imaging时报错:The _imaging C module is not installed的问题的解决方法,引起的原因是PIL库的库文件没有加到系统中导致老是提示这个错误,感兴趣的同学参考下.

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

 



最新网友评论  共有(1)条评论 发布评论 返回顶部
fau 发布于2015-09-08 08:37:28
厉害
支持(0)  反对(0)  回复

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务