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

Error in bt_mediator with werkzeug 3.0 #105

Open
taladar opened this issue Oct 2, 2023 · 5 comments
Open

Error in bt_mediator with werkzeug 3.0 #105

taladar opened this issue Oct 2, 2023 · 5 comments

Comments

@taladar
Copy link

taladar commented Oct 2, 2023

ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/lib/python3.12/site-packages/werkzeug/urls.py). Did you mean: 'unquote'?
@taladar
Copy link
Author

taladar commented Oct 2, 2023

Same error (just with a different path) if I install it via pipx

@taladar
Copy link
Author

taladar commented Oct 2, 2023

It works to create a constraint file

werkzeug<3.0

and then use

pipx install --force --pip-args "-c brotab.constraints.txt" brotab

to install brotab as a workaround but that constraint should probably be in the requirements.txt instead.

@digitalsignalperson
Copy link

digitalsignalperson commented Oct 3, 2023

I also just ran into this trying to set up brotab. I found a workaround from https://stackoverflow.com/questions/77213053/importerror-cannot-import-name-url-quote-from-werkzeug-urls
adding Werkzeug==2.2.2 to requirements/base.txt

commentor from stackoverflow says:

The root cause of this is that Werkzeug 3.0.0 removed previously deprecated code
...
Please update your Flask version, Flask 2.2.2 is unsupported

Also it may be a helpful troubleshooting tip to note somewhere, or for anyone who finds this: if bt commands have no output, try running venv/bin/bt_mediator and see the output

@doctorcolossus
Copy link

Here's an alternative PR to fix only this issue, without other changes.

Also note that I have specified Werkzeug<3.0, whereas @digitalsignalperson specified Werkzeug==2.2.2. With my constraint, pip pulled Werkzeug 2.3.7 in for me on Ubuntu 20.04, and it works fine.

@gaurab15
Copy link

#37 is referencing the same issue

Also it may be a helpful troubleshooting tip to note somewhere, or for anyone who finds this: if bt commands have no output, try running venv/bin/bt_mediator and see the output

I found the solution the same way. This tip would definitely help while @doctorcolossus's PR #109 is still open

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