Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1466

Google App Engine Flexible environment for Python with Flask and Gunicorn

$
0
0

I used to have a setup for my google app engine python project with the following app.yaml:

runtime: pythonenv: flexentrypoint: gunicorn -b :$PORT main:appruntime_config:  python_version: 3resources:  cpu: 1  memory_gb: 2.3  disk_size_gb: 10  volumes:  - name: ramdisk1    volume_type: tmpfs    size_gb: 0.5manual_scaling:  instances: 1

And a requirements.txt that looks like this:

Flask==0.12.2gunicorn==19.7.1numpy==1.8.0scipy==1.5.3mysql-connector-python==8.0.23

But Google made it so you can no longer deploy using python version 3, now instead the app.yaml file must look like this or something similar:

runtime_config:  operating_system: "ubuntu22"  runtime_version: "3.12"

This makes my requirements.txt not work and I keep changing it, my latest version is this:

Flask==2.0.3gunicorn==22.0.0numpy==2.1.1scipy==1.14.0mysql-connector-python==9.0.0Jinja2==3.1.1MarkupSafe==2.1.1Werkzeug==2.0.3

No matter how much I change it or what versions I change for these libraries, I always get some sort of error whether it be gunicorn, flask, Werkzeug, or Jinja2.

This latest version gives me an error when trying to deploying with gcloud app deploy: ImportError: cannot import name 'Markup' from 'jinja2' (/layers/google.python.pip/pip/lib/python3.11/site-packages/jinja2/init.py). I also use Python 3.10 instead of 3.12 since it seems to give me more errors.

If anyone can give me a requirements.txt that works with gunicorn and Flask with a python version that can still be deployed that would be most appreciated.


Viewing all articles
Browse latest Browse all 1466

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>