Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with werkzeug and flask in nginx-flask-mysql #423

Open
iyad-obeid opened this issue Mar 20, 2024 · 4 comments
Open

problem with werkzeug and flask in nginx-flask-mysql #423

iyad-obeid opened this issue Mar 20, 2024 · 4 comments

Comments

@iyad-obeid
Copy link

There is some sort of version / dependency issue with Flask and Werkzeug:

cd nginx-flask-mysql
docker compose up

Crashes with the following trace, over and over:

nginx-flask-mysql-backend-1  | Traceback (most recent call last):
nginx-flask-mysql-backend-1  |   File "/usr/local/bin/flask", line 5, in <module>
nginx-flask-mysql-backend-1  |     from flask.cli import main
nginx-flask-mysql-backend-1  |   File "/usr/local/lib/python3.10/site-packages/flask/__init__.py", line 7, in <module>
nginx-flask-mysql-backend-1  |     from .app import Flask as Flask
nginx-flask-mysql-backend-1  |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 28, in <module>
nginx-flask-mysql-backend-1  |     from . import cli
nginx-flask-mysql-backend-1  |   File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 18, in <module>
nginx-flask-mysql-backend-1  |     from .helpers import get_debug_flag
nginx-flask-mysql-backend-1  |   File "/usr/local/lib/python3.10/site-packages/flask/helpers.py", line 16, in <module>
nginx-flask-mysql-backend-1  |     from werkzeug.urls import url_quote
nginx-flask-mysql-backend-1  | ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/local/lib/python3.10/site-packages/werkzeug/urls.py)
nginx-flask-mysql-backend-1 exited with code 1

@ElRapt
Copy link

ElRapt commented Apr 4, 2024

This is a version problem. I had the same. I haven't looked much into it to understand the real issue, however, I found that those two versions work together. :

Werkzeug==2.3.7
flask==2.2.2

@iyad-obeid
Copy link
Author

That did the trick! You might consider making that change to the repo, it would be really helpful. Thanks!

@Remi-Gau
Copy link

bumping the flask version should work too

Flask==3.0.3
mysql-connector==2.2.9

More info here: https://stackoverflow.com/a/77214086

@Gabrielfernandes7
Copy link

So, you can use libs without number version, like:

Flask
mysql-connector

In this way, you'd use the latest versionof the libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants