python--安装PIL

PIL:Python Imaging Library,已经是Python平台事实上的图像处理标准库了。PIL功能非常强大,但API却非常简单易用。

安装PIL

在Debian/Ubuntu Linux下直接通过apt安装:

$ sudo apt-get install python-imaging


在windows平台要到PIL官网下载exe安装包,如果是64位系统安装时会报“Python version 2.7 required, which was not found in the registry”错误。

非官方的64位库:

http://www.lfd.uci.edu/~gohlke/pythonlibs/

叫做Pillow,下载下来,是个 .whl 结尾的文件,这个其实就是python使用的一种压缩文件,后缀名改成zip,可以打开。

这个需要用 pip 安装。

pip install Pillow-3.3.1-cp27-cp27m-win_amd64.whl

 

进python 命令行 

from PIL import Image

OK,安装成功了。用法和PIL一样

 
posted @ 2016-08-21 10:51  Pyerlife  阅读(2668)  评论(0编辑  收藏  举报