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' #10

Open
dgfonseca opened this issue Mar 8, 2024 · 0 comments
Open

Comments

@dgfonseca
Copy link

Hello,

I was working on the [AI/ML Intelligent Applications for the Edge] workshop but I found an error associated to Werkzeug dependency. Flask doesn't specify the Werkzeug dependency version so it throws the following exception due to the deprecated removed code called:

---> Serving application with gunicorn (wsgi) with default settings ...
[2024-03-08 19:56:25 +0000] [7] [INFO] Starting gunicorn 21.2.0
[2024-03-08 19:56:25 +0000] [7] [INFO] Listening at: http://0.0.0.0:8080 (7)
[2024-03-08 19:56:25 +0000] [7] [INFO] Using worker: sync
[2024-03-08 19:56:25 +0000] [22] [INFO] Booting worker with pid: 22
[2024-03-08 19:56:25 +0000] [22] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/opt/app-root/lib64/python3.9/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
worker.init_process()
File "/opt/app-root/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/opt/app-root/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
File "/opt/app-root/lib64/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/opt/app-root/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
File "/opt/app-root/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
File "/opt/app-root/lib64/python3.9/site-packages/gunicorn/util.py", line 371, in import_app
mod = importlib.import_module(module)
File "/usr/lib64/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/opt/app-root/src/wsgi.py", line 1, in
from flask import Flask, render_template, Response, request
File "/opt/app-root/lib64/python3.9/site-packages/flask/init.py", line 7, in
from .app import Flask as Flask
File "/opt/app-root/lib64/python3.9/site-packages/flask/app.py", line 27, in
from . import cli
File "/opt/app-root/lib64/python3.9/site-packages/flask/cli.py", line 17, in
from .helpers import get_debug_flag
File "/opt/app-root/lib64/python3.9/site-packages/flask/helpers.py", line 14, in
from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/opt/app-root/lib64/python3.9/site-packages/werkzeug/urls.py)
[2024-03-08 19:56:25 +0000] [22] [INFO] Worker exiting (pid: 22)
[2024-03-08 19:56:25 +0000] [7] [ERROR] Worker (pid:22) exited with code 3
[2024-03-08 19:56:25 +0000] [7] [ERROR] Shutting down: Master
[2024-03-08 19:56:25 +0000] [7] [ERROR] Reason: Worker failed to boot.

I solved the problem setting an specific versión of Werkzeug dependency in the requirements.txt.

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