python PIL下的各類問題

爲了實現驗證碼的功能,使用了PIL。結果出現各類問題:ubuntu

先是"ImportError: The _imagingft C module is not installed",google了很長時間,在公司windows下不知怎麼卸載又安裝PIL竟然好了,但殊不知道到底怎麼回事,稀裏糊塗的驗證碼就能夠出來了。晚上在家裏ubuntu下,搞了很長時間終於算是弄好了。windows

最終的解決方案仍是,不用PIL了。使用pillow。同時解決了「ioerror encoder zip not available」google

pillow的使用方式有所變化:spa

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-availablecode

相關文章
相關標籤/搜索