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

ImportError: cannot import name 'url_quote' from 'werkzeug.urls' #106

Open
vlyalcin opened this issue May 26, 2024 · 1 comment
Open

ImportError: cannot import name 'url_quote' from 'werkzeug.urls' #106

vlyalcin opened this issue May 26, 2024 · 1 comment

Comments

@vlyalcin
Copy link

Hi;

First of all, thank you for sharing this great work with everyone.

I am running the project on Ubuntu 24.04 LTS with Python 3.12, but I am encountering the following error.

(venv) user@server:~/project$ python hook.py
Traceback (most recent call last):
  File "/path/to/project/hook.py", line 5, in <module>
    from flask import Flask, request, make_response
  File "/path/to/project/venv/lib/python3.12/site-packages/flask/__init__.py", line 5, in <module>
    from .app import Flask as Flask
  File "/path/to/project/venv/lib/python3.12/site-packages/flask/app.py", line 30, in <module>
    from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/path/to/project/venv/lib/python3.12/site-packages/werkzeug/urls.py). Did you mean: 'unquote'?

Has anyone encountered this error before? How can I resolve it?

Thanks.

@vlyalcin
Copy link
Author

According the information share in reference, I fixed the issue by specifying the lower version of the Werkzeug library in the requirements.txt file.

Solution: Just set a fix version for Werkzeug such as Werkzeug==2.2.2 in your requirements.txt and it should work.

Reference: https://stackoverflow.com/a/77214086/1176555

@vlyalcin vlyalcin closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2024
@vlyalcin vlyalcin reopened this May 26, 2024
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

1 participant