Reputation: 874
I have built an app for Google App Engine and while I tried running the app, it worked well. But when I deployed it, it threw internal server 500 error. When I checked the error report, it said, "No module named cloud in the directory"
Below is my requirements.txt
gunicorn==19.3.0
twilio==6.8.4
google-cloud-automl==0.1.1
google-cloud-storage==1.0.0
google-cloud==0.34.0
GoogleAppEngineCloudStorageClient==1.9.22.1
My Yaml file is as follows
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: .*
script: main.app
Imports used in the python file are
from google.cloud import automl_v1beta1 as automl
from google.cloud import storage
It worked when I ran manually. But after deploying , the error is
ImportError: No module named cloud
<module> (/base/data/home/apps/..
Thank you in advance
Upvotes: 3
Views: 1221
Reputation: 5506
Please execute pip install google-cloud-automl
.
This will fix the problem.
Upvotes: 0
Reputation: 21520
It looks like you're trying to deploy to the "First Generation" App Engine runtime. Unfortunately, you can't use the google-cloud
Python libraries there.
The good news is that you can use the "Second Generation" instead, which allows you to install any library, including any of the google-cloud
libraries like google-cloud-storage
.
See this link for the difference between the two generations: https://cloud.google.com/appengine/docs/standard/appengine-generation
Google App Engine Python 3 Standard Environment Documentation: https://cloud.google.com/appengine/docs/standard/python3/
Upvotes: 2
Reputation: 3325
First of all, the google-cloud
package has been deprecated.
Second, you can't use the google-cloud-*
libraries in App Engine Standard. You have to use other alternatives, like GoogleAppEngineCloudStorageClient
.
Upvotes: 1