Count
Count

Reputation: 1423

GCP could not find flask when it is present in lib folder

I am trying to deploy a python flask app to GCP by following the standard guideline I have installed my requirements.txt to the lib folder using command

 pip install -t lib -r requirements.txt

but the server is failing at runtime with ImportError for flask module this is hapoening both locally and on cloud ie with

dev_appserver.py  app.yaml #locally
gcloud app deploy # On cloud

but when I open the lib folder I could see the dependency there

Here is what my requirements.txt looks like

requests>=2.19.1
pandas==0.20.3
python-telegram-bot==11.1.0
Quandl>=3.4.0
redis
stockstats==0.2.0
flask
flask-socketio
python-socketio
flask-login

Upvotes: 0

Views: 107

Answers (1)

Alex
Alex

Reputation: 5276

1 - Do you have the file appengine_config.py

with the following 2 lines:

from google.appengine.ext import vendor
vendor.add('lib')

https://cloud.google.com/appengine/docs/standard/python/tools/using-libraries-python-27

2 - does your lib folder have a __init__.py in it

Upvotes: 1

Related Questions