2016-10-22 35 views
0

我在Windows上的Python 2.7中导入图像库时遇到问题。当我写:在Windows上导入图像

import Image 

我有错误:

No module named Image

库中项目设置中添加,所以我尝试

from PIL import Image

不幸的是我现在有一个错误

raise IOError("decoder %s not available" % decoder_name) 
IOError: decoder zip not available 

我不知道该怎么做。

+0

假设你的Python安装的其余部分的工作,我会尝试手动下载并安装['pillow'](来自pypi包索引的https://pypi.python.org/pypi/Pillow)模块。 – martineau

+0

http://stackoverflow.com/questions/3544155/about-the-pil-error-ioerror-decoder-zip-not-available – xli

+0

它不为我工作 – abioticGirl

回答

2

对于Windows:

python -m pip install Pillow 

然后在你的Python代码:

from PIL import Image