2013-12-16 85 views
5

當嘗試使用PIP安裝Python圖像庫(PIL),安裝失敗,出現以下錯誤:無法安裝Python圖像庫PIP

SyntaxError: invalid syntax 
Complete output from command python setup.py egg_info: 
Traceback (most recent call last): 

File "<string>", line 16, in <module> 
File "/tmp/pip_build_root/pil/setup.py", line 182 
print "--- using Tcl/Tk libraries at", TCL_ROOT 

Somebody否則面臨着同樣的問題,但所提供的解決方案是爲一個不同的圖書館,並沒有爲我工作。在官方郵件列表中有一箇舊的條目(2003)討論了這個問題,但不是提供解決方案,而是要求降級PIL並稍後提供修復(我不願意降級)。

的pip.log文件在這裏提供:http://pastebin.com/YeBLmMBm

+0

據我所知,PIL不能與'pip'一起安裝。這就是爲什麼可選的枕頭存在。 –

回答

7

有PIL叫枕一個新的分支,這似乎對很多人比PIL更一致地工作。它也很容易安裝。看here(對於info/docs)和here(要安裝)。雖然我認爲pip install Pillow應該工作

+2

謝謝。我正試圖在Django中爲ImageField安裝PIL,我發現了一個解決枕頭[這裏]的解決方法(http://stackoverflow.com/questions/15080121/how-to-use-pillow-with-django)。 – Sayem