PIL模块,官方(地址)给出的都是32位的版本,对于64位的机子安装之后的结果就是图像无法显示。
幸运的是已经有人做出了针对64位系统的非官方库 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 这个库叫做Pillow,下载下来,是个 .whl 结尾的文件,这个其实就是python使用的一种压缩文件,后缀名改成zip,可以打开。
这个需要用 pip 安装。
pip install Pillow-2.7.0-cp27-none-win_amd64.whl 即可。
需要注意的是
Pillow is a replacement for PIL, the Python Image Library, which provides image processing functionality and supports many file formats.
Use `from PIL import Image` instead of `import Image`. 所以引用的时候 是要用 ‘ from PIL import Image' 代替 'import Image'
至此安装成功了,用法和PIL是一样的。