第1个回答 2017-10-23
Mac OSX
brew update
brew install libjpeg libpng
装这两个就够了
Ubuntu 14.0.4
sudo apt-get install libjpeg-dev libpng12-dev libfreetype6-dev libtiff-dev
Linux 上比较惨一些,要多装几个包.
这还不够的, 最好就直接用 Pillow 这个 python 包来取代手工下载 Imaging 这个包吧,直接用以下指令
pip install -I --no-cache-dir -v Pillow
这个指令执行完毕会有一大堆的信息,不用管它,只要找到以下这个就行了:
--------------------------------------------------------------------
PIL SETUP SUMMARY
--------------------------------------------------------------------
version Pillow 3.2.0
platform linux2 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
*** OPENJPEG (JPEG2000) support not available
--- ZLIB (PNG/ZIP) support available
*** LIBTIFF support not available
--- FREETYPE2 support available
*** LITTLECMS2 support not available
*** WEBP support not available
*** WEBPMUX 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.
To check the build, run the selftest.py script.