我正在MacOS上为googleappengine开发Python应用程序,我在尝试为本地开发设置PIL时遇到了困难。我在virtualenv中运行Python 2.5,还使用pip在virtualenv中安装了PIL 1.1.7:
pip install PIL
我可以在python解释器中导入,看起来一切正常,但是当App Engine SDK使用它时,会出现以下错误:
^{pr2}$似乎在PIL导入ICCProfile时会发生此错误,但except也应该捕捉到它并正确处理。这是来自PngImagePlugin.py公司名称:
try:
import ICCProfile
p = ICCProfile.ICCProfile(im.info["icc_profile"])
name = p.tags.desc.get("ASCII", p.tags.desc.get("Unicode", p.tags.desc.get("Macintosh", p.tags.desc.get("en", {}).get("US", "ICC Profile")))).encode("latin1", "replace")[:79]
except ImportError:
name = "ICC Profile"
在寻找解决方案时,我得到的建议是我应该创造PIL.pth公司具有PIL路径的文件,但此文件已存在于virtualenv in-site packages文件夹中,并且该文件的内容为:
PIL
有人对如何修复它有什么建议吗?或者我还能试试什么呢?在
尝试使用Pillow代替PIL。在
更新1
看这个线程http://code.activestate.com/lists/python-image-sig/6543/
相关问题 更多 >
编程相关推荐