This question already has an answer here:
这个问题已经有了答案:
- The problem with installing PIL using virtualenv or buildout 4 answers
- 使用virtualenv或构建4个答案安装PIL的问题
I have also tried
我也试过
from PIL import Image
but it gives me ImportError: No module named PIL.
但它给了我极大的恐惧:没有一个模块叫PIL。
I have installed PIL successfully using
我已经成功地安装了PIL
pip install pil
and I've also installed xcode command line tools. Nothing seem to work.
我还安装了xcode命令行工具。似乎没有什么工作。
Details:
细节:
Mac OS X 10.9
Mac OS X 10.9
Python 2.7.6
Python 2.7.6
python is /Library/Frameworks/Python.framework/Versions/2.7/bin/python
python /图书馆/框架/ Python.framework /版本/ 2.7 / bin / python
python is /usr/bin/python
python是/usr/bin/python
python is /usr/local/bin/python
python是/usr/local/bin/python
Name: PIL
名称:公益诉讼
Version: 1.1.7
版本:1.1.7
Location: /usr/local/lib/python2.7/site-packages/PIL
地点:/usr/local/lib/python2.7/site-packages /公益诉讼
2 个解决方案
#1
27
The PIL distribution is mispackaged for egg installation.
在鸡蛋的安装过程中,其分布是错误的。
Install Pillow instead, the friendly PIL fork.
代之以装枕,PIL友好的叉。
#2
0
On a system with both Python 2 and 3 installed and with pip2
-installed Pillow failing to provide Image
, it is possible to install PIL for Python 2 in a way that will solve ImportError: No module named Image
:
系统上安装了Python 2和3的和pip2-installed枕头无法提供图片,可以为Python 2安装公益诉讼的方式将解决ImportError:没有模块命名图片:
easy_install-2.7 --user PIL
or
或
sudo easy_install-2.7 PIL
#1
27
The PIL distribution is mispackaged for egg installation.
在鸡蛋的安装过程中,其分布是错误的。
Install Pillow instead, the friendly PIL fork.
代之以装枕,PIL友好的叉。
#2
0
On a system with both Python 2 and 3 installed and with pip2
-installed Pillow failing to provide Image
, it is possible to install PIL for Python 2 in a way that will solve ImportError: No module named Image
:
系统上安装了Python 2和3的和pip2-installed枕头无法提供图片,可以为Python 2安装公益诉讼的方式将解决ImportError:没有模块命名图片:
easy_install-2.7 --user PIL
or
或
sudo easy_install-2.7 PIL