PureDevOps Community

Solved: ImportError: cannot import name 'url_quote' from 'werkzeug.urls'

I have a backend application in Flask 2.0.2 and running my app in Python3.8 , It was all working well till last week . All of a sudden i face this problem when i start the application using gunicorn

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

This problem arises when a library called werkzeug with dependencies was recently updated to 3.0.0. Therefore, clone the repository and add werkzeug==2.2.2 to requirements.txt. And try running pip install -r requirements.txt.

And running the app back solved the problem.