python PIL下的各种问题

时间:2014-05-07 09:21:14   收藏:0   阅读:425

为了实现验证码的功能,使用了PIL。结果出现各种问题:

先是"ImportError: The _imagingft C module is not installed",google了很长时间,在公司windows下不知怎么卸载又安装PIL居然好了,但却不知道到底怎么回事,稀里糊涂的验证码就可以出来了。晚上在家里ubuntu下,搞了很长时间终于算是弄好了。

最终的解决方案还是,不用PIL了。使用pillow。同时解决了“ioerror encoder zip not available”

pillow的使用方式有所变化:

bubuko.com,布布扣
Pillow is a fork of PIL that is compatible with pip/setuptools and gets a little better maintenance. I havent seen any API differences yet.

Edit: There is one notable API difference. PIL exposes Image as a top-level namespace, so you can

import Image # in PIL only

but

from PIL import Image  # in pillow or PIL
bubuko.com,布布扣

 

参考自:http://stackoverflow.com/questions/3544155/about-the-pil-error-ioerror-decoder-zip-not-available

python PIL下的各种问题,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!