在 python 2.7.10 MAC OS X 上安装 PIL 1.1.7 失败

Install PIL 1.1.7 failed on python 2.7.10 on MAC OS X

当我尝试在 MAC OS X

python 2.7.10 上安装 PIL 1.1.7 失败时,我遇到了以下错误
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
 version       1.1.7
 platform      darwin 2.7.10 (default, Oct 23 2015, 19:19:21)
              [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]
--------------------------------------------------------------------
--- TKINTER support available
*** JPEG support not available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available
--------------------------------------------------------------------
 To add a missing option, make sure you have the required
 library, and set the corresponding ROOT variable in the
 setup.py script.

当库 freetype 未安装时,消息 ImportError: The _imagingft C module is not installed 出现 apparently。因此,要修复此错误,您需要安装 freetype 并重新编译 PIL。

我在升级 pip 时遇到了类似的问题,这是我所做的(Mac OS 10.11,python 2.7.11)。

首先,你最好使用PIL 1.1.6,因为1.1.7 在python 2.7 在MAC OS X 上有很多问题。

PIL 1.1.6 的安装方法如下:

1.Download PIl : http://www.pythonware.com/products/pil/ (ver1.1.6 更兼容 python 2.7,ver1.1.7 有很多问题)

2.Run 在您的终端中输入此代码(cd 到您的下载目录)

$ tar xvfz Imaging-1.1.6.tar.gz
$ cd Imaging-1.1.6
$ python setup.py install

3.Use 'pip list' 检查你的 PIL.and 如果你也安装枕头,你只能使用 them.so 之一,如果你只想使用 PIL,卸载枕头通过

sudo -s    
pip uninstall pillow