应用引擎SDK PIL

2024-07-03 07:37:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在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

有人对如何修复它有什么建议吗?或者我还能试试什么呢?在


Tags: pip文件namegetpilvirtualenv错误tags