0

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
Count
  • 1,395
  • 2
  • 19
  • 40
  • might be related to: https://stackoverflow.com/questions/14273149/importerror-no-module-named-flask-on-google-app-engine#14307599 where a guy points to his examples on: https://github.com/kamalgill/flask-appengine-template – Sven Sowa May 03 '19 at 11:47
  • @AdamLazaruso yes that is being goes as part of my code , do I need to mention it somewhere ? – Count May 03 '19 at 12:11
  • @AdamLazaruso added to the question – Count May 03 '19 at 12:43
  • Can you share your `app.yaml` and the full traceback? – Dan Cornilescu May 04 '19 at 03:12

1 Answers1

1

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

Alex
  • 5,141
  • 12
  • 26