RuntimeError: NotImplementedError('Unable to find the Python Python Imaging Library. Please view the SDK documentation for details about installing PIL on your system.',).
通过谷歌应用引擎日志我得到了这个错误。 我想上传一张图片。 我已经安装了PIL,但仍然找不到它的显示。 我已经安装好了
^{pr2}$这是应用程序yaml在
application: uniqueappid
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /static
static_dir: static
- url: /.*
script: main.app
libraries:
- name: jinja2
version: latest
- name: PIL
version: 1.1.7
如果由于任何原因无法加载PIL库,则会发生这种情况。我在运行OSX,所以你的解决方案可能会有所不同,但也许描述一下我所做的会帮助其他人。在
对我来说,问题是我的python2.7.13forosx没有附带
yaml
库,因此需要图像库失败了。运行此程序可以解决我的问题:要使images API在本地运行,我需要的安装总数如下:
^{pr2}$这些包需要全局安装,因为它们将由API服务器使用。使用
-t
在本地安装包,并将库目录添加到appengine_config.py
中,都不起作用。在除此之外,我还需要在我的应用程序yaml即使你的枕头版本不一样:
^{3}$如前所述,加载库的问题可能不同,因此我是如何发现缺少的
yaml
依赖关系的:从下面最后一行调用堆栈中,我解释了我的应用程序引擎库驻留在
/Applications/google-cloud-sdk/platform/google_appengine
中:通过阅读代码,我发现负责检测
PIL
是否安装的模块是google.appengine.api.images.images_stub
,因此我做了以下操作:。。导致以下错误:
这使我能够发现导入失败是因为缺少
yaml
模块。在相关问题 更多 >
编程相关推荐