我使用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