我使用Ubuntu和VitualEnv作为我的Django项目。pip install PIL -E票据-1 - 没有JPEG/PNG支持
我有使用新立得包管理器安装PIL库,它工作正常。但是,当我创建一个VitrualEnv并尝试使用PIP它installes安装PIL,但我得到这个奇怪的现象:
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
[GCC 4.5.2]
--------------------------------------------------------------------
*** TKINTER support not available
*** JPEG support not available
*** ZLIB (PNG/ZIP) support not 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.
我希望我可以用requirements.txt为我所有的依赖关系,但可能是PIL有以某种方式手动安装...但如何?
编辑:谢谢约翰·凯斯,你是对的,我跑:
sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/
sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/
sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/
又经过尝试PIL安装我得到:
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
[GCC 4.5.2]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support 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.
编辑:您可能需要安装libfreetype6-dev libjpeg8-dev
谢谢,我尝试了很多东西,但是这是唯一修复它的东西! – deweydb
认为这可能是有用的:http://pythonadventures.wordpress.com/2013/05/19/problems-with-pil-use-pillow-instead/ – user2290820
使用Pillow是一个好的解决方案。 – x4snowman