无法找到Python PIL库.Google App Engine

ben*_*sio 11 python google-app-engine python-imaging-library

安装了Google App Engine SDK.Python 2.6完美版.想要进入图像,并在本地测试.安装PIL

安装了Python,然后运行PIL安装,这次工作.

事情似乎很好,但尝试localhost图像处理给出:

"NotImplementedError: Unable to find the Python PIL library.  Please
 view the SDK documentation for details about installing PIL on your system."
Run Code Online (Sandbox Code Playgroud)

系统:winxp

pea*_*rth 10

我花了一些时间让PIL工作.主要是因为我忘了告诉app引擎将它加载到yaml文件中:

 libraries:
     - name:    PIL
     version: 1.1.7
Run Code Online (Sandbox Code Playgroud)

也许这一步很明显,但我没有在谷歌文档中看到它记录良好,我在这里发现了各种消息,说明PIL在app引擎上不可用.我想确认PIL是否在app引擎上运行.


Bla*_*rad 4

我们可能需要更多信息,因此这里有一些问题和需要尝试的事情。

您如何尝试访问 PIL?您是否尝试直接使用 google.appengine.api.images 模块或 PIL?听起来像前者,但不清楚。

您是否遵循了App Engine 说明

可以的话贴一下代码吧

也许最重要的尝试是:看看是否可以从非 App Engine 脚本使用 PIL。只需编写一个快速的 Python 脚本来访问它,然后看看效果如何。就像是:

import Image
im = Image.open('filename.png')
im.show()
Run Code Online (Sandbox Code Playgroud)

如果这不起作用,那么 Google App Engine 无法与 PIL 配合使用也就不足为奇了。

  • GAE SDK在本地使用PIL,但不允许直接使用PIL。应改用 SDK Image API。GAE 仅提供部分 PIL 功能。 (3认同)