简体   繁体   中英

Google AppEngine local development ImportError

I am trying to setup a flask application that will be deployed on Google App Engine.

My flask application has a dependency on Google Cloud Storage - Datastore. google-cloud , among others.

I ran pip install -t lib -r requirements.txt to install all of my dependencies into lib directory.

When I run dev_appserver.py in root directory of my flask application, I get the following ImportError

ImportError: No module named google.cloud.datastore

Not sure why I see this. Looking at lib directory, it looks like pip installed all my dependencies.

Why isn't local app engine able to find that module.

I realize I should be using App Engine's Datastore, which is slightly different, and requires lot of code changes. But why doesn't App Engine find, and use, Google datastore module

FYI, I am running this on Mac OS-X

You need to create a file named appengine_config.py in the same folder as your app.yaml file, and add the following lines:

# appengine_config.py
from google.appengine.ext import vendor

# Add any libraries install in the "lib" folder.
vendor.add('lib')

Read more here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM