首页 > 技术文章 > python PIL下的各种问题

zeng-wei 2014-05-05 22:44 原文

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

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

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

pillow的使用方式有所变化:

Pillow is a fork of PIL that is compatible with pip/setuptools and gets a little better maintenance. I haven't 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

 

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

推荐阅读