Python 的PIL,可以解决ImportError The _imagingft C module is not installed

删除PIL相关文件
mv PIL /tmp
 
pip install Pillow
安装Pillow后, 可能还会发生KeyError的错误, 检查项目源码后发现是 Image 模块的save函数中 , 处理图片文件格式时报的错.
不管是"JPEG", 还是"GIF", 都会报错, 解决的办法是:
把项目源码中 import Image , 替换成 from PIL import Image 即可.
按这个原理, 项目中所有用到 Image 模块的地方都应该替换掉。
posted @ 2017-02-08 16:21  不太灵光的程序员  阅读(1665)  评论(0编辑  收藏  举报