Missing modules for flask backend #1104
-
Current Situation
ModuleNotFoundError: No module named 'flask_cors' I tried to deploy in GCP. Proposed ActionsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
You need to |
Beta Was 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. |
Beta Was this translation helpful? Give feedback.
-
The installed python is 'Python 3.9.2' |
Beta Was this translation helpful? Give feedback.
-
Be noted that If I use:
It will work. |
Beta Was this translation helpful? Give feedback.
-
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 workers
instance_class: F1
env: 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 -w 2 main:app
runtime_config:
operating_system: "ubuntu22"
runtime_version: "3.11" main.py from reactpy import component, html
from reactpy.backend.flask import configure
from flask import Flask
@component
def HelloWorld():
return html.h1("Hello, world!")
app = Flask(__name__)
configure(app, HelloWorld) requirements.txt
Deploy command.
An example is in my rflask repo. |
Beta Was this translation helpful? Give feedback.
You need to
pip install reactpy[flask]
.