相关疑难解决方法(0)

使用virtualenv或buildout安装PIL的问题

当我使用easy_install或buildout安装PIL时,它会以这种方式安装,我必须执行'import Image',而不是'来自PIL import Image'.

但是,如果我做"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
Run Code Online (Sandbox Code Playgroud)

我明白了,easy_install将PIL打包到Egg中,而PIP则没有.与buildbot相同,它使用鸡蛋.

如何使用easy_install或buildout正确安装PIL?

python pip buildout easy-install python-imaging-library

70
推荐指数
4
解决办法
4万
查看次数