ImportError:没有名为Image的模块

时间:2014-01-30 12:46:31

标签: python macos python-imaging-library

我也试过

from PIL import Image

但它给了我ImportError:没有名为PIL的模块。

我使用

成功安装了PIL
pip install pil

我还安装了xcode命令行工具。似乎没什么用。

详情

Mac OS X 10.9

Python 2.7.6

python是/Library/Frameworks/Python.framework/Versions/2.7/bin/python

python是/ usr / bin / python

python是/ usr / local / bin / python

名称:PIL

版本:1.1.7

位置:/usr/local/lib/python2.7/site-packages/PIL

2 个答案:

答案 0 :(得分:37)

PIL分发包装错误,以便安装鸡蛋。

安装Pillow代替友好的PIL分叉。

答案 1 :(得分:0)

在安装了Python 2和3且安装了pip2的系统上 - 安装的Pillow无法提供Image,可以以解决{{1}的方式安装PIL for Python 2 }}:

ImportError: No module named Image

easy_install-2.7 --user PIL