GAE NDB install deployed

2019-03-01 06:26发布

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条回答
走好不送
2楼-- · 2019-03-01 07:12

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.

查看更多
登录 后发表回答