![zlib 对 PIL 的支持不起作用](https://linux22.com/image/21414/zlib%20%E5%AF%B9%20PIL%20%E7%9A%84%E6%94%AF%E6%8C%81%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我正在尝试按照 debian 上的说明安装 PIL,但不知道如何修复此位:
我得到 --- build_ext 上提供 ZLIB (PNG/ZIP) 支持*自测试时未安装 ZLIB (PNG/ZIP) 支持
我缺少什么?
root@portman:~/dist/Imaging-1.1.7# python setup.py build_ext -i
running build_ext
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.7.2+ (default, Dec 1 2011, 01:55:02)
[GCC 4.6.2]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
--- LITTLECMS support 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.
root@portman:~/dist/Imaging-1.1.7# python selftest.py
--------------------------------------------------------------------
PIL 1.1.7 TEST SUMMARY
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from ./PIL
--------------------------------------------------------------------
--- PIL CORE support ok
*** TKINTER support not installed
--- JPEG support ok
*** ZLIB (PNG/ZIP) support not installed
--- FREETYPE2 support ok
--- LITTLECMS support ok
--------------------------------------------------------------------
Running selftest:
--- 57 tests passed.
答案1
PIL 已经打包在 Debianpython-imaging
包中:apt-get install python-imaging
。
如果您确实想手动安装它,您可能需要安装 zlib1g-dev 软件包。