balta2ar / brotab

Control your browser's tabs from the command line
MIT License
389 stars 27 forks source link

Error in bt_mediator with werkzeug 3.0 #105

Open taladar opened 10 months ago

taladar commented 10 months ago
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/lib/python3.12/site-packages/werkzeug/urls.py). Did you mean: 'unquote'?
taladar commented 10 months ago

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

taladar commented 10 months ago

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 commented 10 months ago

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 commented 9 months ago

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 commented 6 months ago

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