Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 应用程序引擎SDK PIL错误_Python_Image_Google App Engine_Python Imaging Library - Fatal编程技术网

Python 应用程序引擎SDK PIL错误

Python 应用程序引擎SDK PIL错误,python,image,google-app-engine,python-imaging-library,Python,Image,Google App Engine,Python Imaging Library,我正在为MacOS上的Google App Engine开发Python应用程序,在尝试为本地开发设置PIL时遇到了麻烦。我在virtualenv中运行Python 2.5,并且还使用pip在virtualenv中安装了PIL 1.1.7: pip install PIL 我可以在python解释器中导入它,看起来一切正常,但是当它被App Engine SDK使用时,会出现以下错误: File "/Users/user/Development/src/virtualenv/lib/pytho

我正在为MacOS上的Google App Engine开发Python应用程序,在尝试为本地开发设置PIL时遇到了麻烦。我在virtualenv中运行Python 2.5,并且还使用pip在virtualenv中安装了PIL 1.1.7:

pip install PIL
我可以在python解释器中导入它,看起来一切正常,但是当它被App Engine SDK使用时,会出现以下错误:

File "/Users/user/Development/src/virtualenv/lib/python2.5/site-packages/PIL/PngImagePlugin.py", line 564, in _save
SystemError: Parent module 'PIL' not loaded
似乎在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路径的PIL.pth文件,但该文件已存在于virtualenv in site packages文件夹中,该文件的内容为:

PIL
有没有人对如何修复它有任何建议,或者我可以尝试其他什么?

尝试使用而不是PIL

更新1
查看此线程

我尝试过,但开发服务器引发以下错误:NotImplementedError:找不到Python PIL库。有关在系统上安装PIL的详细信息,请查看SDK文档。OFC当PIL发生冲突时,您需要首先删除它们。无论如何,您的回溯显示您的PIL安装已完全中断。它应该是“site packages/PIL/PngImagePlugin.py”,而不是“site packages/PIL-1.1.7/PIL/PngImagePlugin.py”。因此,始终使用Pillow:DI在安装Pillow之前卸载了PIL,然后收到前面提到的错误。PIL安装文件夹是pip安装创建的默认文件夹,我没有更改它。