當我使用easy_install或buildout安裝PIL時,它以這種方式安裝,我必須執行'導入映像',而不是'從PIL導入映像'。使用virtualenv或buildout安裝PIL的問題
但是,如果我做「apt-get install python-imaging」或使用「pip -E test_pil install PIL」,一切正常。
下面是我如何嘗試使用的virtualenv安裝PIL例子:
# virtualenv --no-site-packages test_pil
# test_pil/bin/easy_install PIL
# test_pil/bin/python
Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import PIL
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PIL
我看到,easy_install的包PIL打入雞蛋,和PIP沒有。與buildbot一樣,它使用雞蛋。
如何使用easy_install或buildout正確安裝PIL?
作者被通知了這個,以便它也固定在pypi上嗎? – blueyed 2010-03-29 23:20:14
我瞭解到作者對修復pypi沒有興趣。 – 2010-04-05 15:52:19
我試過了你的例子中顯示的版本,但我仍然有同樣的問題。我最終使用了pythonware網站上的安裝程序,然後將PIL目錄和PIL.pth文件複製到virtualenv中,併爲我解決了這個問題。 – tponthieux 2011-02-07 06:45:36