Missing modules for flask backend #1104
-
Current Situation
ModuleNotFoundError: No module named 'flask_cors' I tried to deploy in GCP. Proposed ActionsNo response |
BetaWas this translation helpful?Give feedback.
Replies: 5 comments 3 replies
-
You need to |
BetaWas this translation helpful?Give feedback.
-
I put After from GCP cloud shell, I got this error and warning. I cancelled as it is taking too much time. |
BetaWas this translation helpful?Give feedback.
-
The installed python is 'Python 3.9.2' |
BetaWas this translation helpful?Give feedback.
-
Be noted that If I use: It will work. |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I finally got it to work. The app yaml file is using flexible environment. Using standard environment does not work so far. app.yaml runtime: python# F1 = 2 workers (default), F2 = 4 workersinstance_class: F1env: flex# -w 2 sets gunicorn number of workers# The number of workers you specify should match the instance class of your App Engine app:entrypoint: gunicorn-b :$PORT-w2main:appruntime_config: operating_system: "ubuntu22"runtime_version: "3.11"main.py fromreactpyimportcomponent, htmlfromreactpy.backend.flaskimportconfigurefromflaskimportFlask@componentdefHelloWorld(): returnhtml.h1("Hello, world!") app=Flask(__name__) configure(app, HelloWorld)requirements.txt Deploy command. An example is in my rflask repo. |
BetaWas this translation helpful?Give feedback.
You need to
pip install reactpy[flask].