GAE NDB install deployed

左心房为你撑大大i 提交于 2019-12-02 20:19:32

问题


My Google App Engine app uses Datastore NDB. So I am importing:

from google.appengine.ext import ndb

but when I deploy and go to my app there is an error:

ModuleNotFoundError: No module named 'google.appengine'

so how do I get GAE to install this part of the Google Cloud SDK?


回答1:


You didn't say which runtime you're trying to deploy to (Python 2.7 or 3.7) but I'm guessing it's 3.7.

The google.appengine module is only available in the first-generation Python 2.7 runtime. If you need to use it, you will need to deploy your app to this runtime.

From Using the ndb client library:

The ndb client library is not compatible with the Python 3.7 runtime. For more information, see differences between the Python 2.7 and Python 3.7 runtimes on the App Engine standard environment.



来源:https://stackoverflow.com/questions/52558550/gae-ndb-install-deployed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!