Import error on deploy only: No module named google.appengine.api
See original GitHub issueI’ve been following the tutorial, in particular section 6-pubsub. I have the project working locally just fine, but when I try to deploy, I get a timeout. See the stacktrace from the logs below. The import error is:
ImportError: No module named 'google.appengine.api'
and it occurs when I try to make a new logging Client. I’ve seen the same issue in another project when I try to make a new pubsub Client.
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | File "/home/vmagent/app/main.py", line 19, in <module>
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | app = bookshelf.create_app(config)
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | File "/home/vmagent/app/bookshelf/__init__.py", line 40, in create_app
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | client = google.cloud.logging.Client(app.config['PROJECT_ID'])
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | File "/env/lib/python3.4/site-packages/google/cloud/client.py", line 186, in __init__
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | Client.__init__(self, credentials=credentials, http=http)
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | File "/env/lib/python3.4/site-packages/google/cloud/client.py", line 122, in __init__
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | credentials = get_credentials()
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | File "/env/lib/python3.4/site-packages/google/cloud/credentials.py", line 87, in get_credentials
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | return client.GoogleCredentials.get_application_default()
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | File "/env/lib/python3.4/site-packages/oauth2client/client.py", line 1288, in get_application_default
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | return GoogleCredentials._get_implicit_credentials()
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | File "/env/lib/python3.4/site-packages/oauth2client/client.py", line 1273, in _get_implicit_credentials
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | credentials = checker()
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | File "/env/lib/python3.4/site-packages/oauth2client/client.py", line 1191, in _implicit_credentials_from_gae
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | return _get_application_default_credential_GAE()
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | File "/env/lib/python3.4/site-packages/oauth2client/client.py", line 1450, in _get_application_default_credential_GAE
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | from oauth2client.contrib.appengine import AppAssertionCredentials
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | File "/env/lib/python3.4/site-packages/oauth2client/contrib/appengine.py", line 27, in <module>
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | from google.appengine.api import app_identity
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 worker.1 | ImportError: No module named 'google.appengine.api'
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 system | worker.1 stopped (rc=1)
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 system | sending SIGTERM to monitor.1 (pid 8)
2016-11-02 17:02:18 worker[20161102t123058] 17:02:18 system | monitor.1 stopped (rc=-15)
Issue Analytics
- State:
- Created 7 years ago
- Comments:25
Top Results From Across the Web
Fixing python import error “No module named appengine”
If it throws an import error, it means that either the App Engine SDK is not installed, or at least the Python run-time...
Read more >[No module named 'google.appengine ... - Stack Overflow
1 Answer 1 · 1. hey Dustin, just a another quick question. So one of the imports is from google.appengine.api import datastore ....
Read more >No module named 'google.appengine'
I have built an app using Google App Engine. As the next step, I would like to use task queues but when I...
Read more >ModuleNotFoundError: No module named 'main' - Server Fault
This line says to look for the variable named app in the module named main.py: entrypoint: gunicorn -b:$PORT main:app.
Read more >Access legacy bundled services for Python 3 - Google Cloud
You can find the SDK on GitHub under the appengine-python-standard repo, ... migrate the code to Python 3 and deploy and test using...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you. I’m trying to reproduce. This error is extremely bewildering.
@theacodes
please help me, i have same issue No module named ‘google.appengine’
my requirements.txt
app.yam
thank you