【发布时间】:2013-06-07 18:40:52
【问题描述】:
我有一个安装了 ActivePython 2.7 32 位的 Windows 8 机器。我通过以下方式安装 PIL:
pypm install pil
一切正常,但如果我尝试将“保存”功能与“png”一起使用,如下所示:
import PIL.Image
PIL.Image.new( 'RGB', (100,100) ).save( 'file.png' )
我遇到了一个错误:
File "C:\Users\Eye.DEV\AppData\Roaming\Python\Python27\site-packages\PIL\Image.py", line 401, in _getencoder
raise IOError("encoder %s not available" % encoder_name)
IOError: encoder zip not available
这很奇怪,因为 import zlib 工作正常,所以我的 ActivePython 安装显然有 zip 支持。是一些错误,PIL 不打算在 Windows 上使用/作为二进制安装,还是我做错了什么?
请注意,此行为是特定于 Windows 的。在 buntu/Debian 或 OSX 下一切正常。
【问题讨论】:
-
一个类似的问题没有答案,但有许多可能的解决方案的链接:stackoverflow.com/questions/15258335/…
-
@JanneKarila 您提到的问题与具有多个
python安装的linux设置有关。我有一个干净的Windows盒子,安装了单个ActivePython- 所以其他问题中提到的所有问题都不能在这里应用:(。
标签: python python-imaging-library