WebShop icon indicating copy to clipboard operation
WebShop copied to clipboard

Problem with WerkZeug version

Open BiplabG opened this issue 1 year ago • 1 comments

The current version of WebShop (Commit: 64fa2a5) uses Flask 2.1.2 which uses WerkZeug library. WerkZeug recently released its new breaking version 3.x. Installation of WebShop installs the latest WerkZeug library which is incompatible with the current code.

How to replicate:

  1. Clone the repo.
  2. Run setup.sh
  3. ./run_dev.sh

Error observed:

(.venv) bgautam@c430:~/webshop/WebShop$ ./run_dev.sh 
Traceback (most recent call last):
  File "/home/bgautam/.pyenv/versions/3.10.14/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/bgautam/.pyenv/versions/3.10.14/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/bgautam/webshop/WebShop/web_agent_site/app.py", line 5, in <module>
    from flask import (
  File "/home/bgautam/webshop/.venv/lib/python3.10/site-packages/flask/__init__.py", line 7, in <module>
    from .app import Flask as Flask
  File "/home/bgautam/webshop/.venv/lib/python3.10/site-packages/flask/app.py", line 27, in <module>
    from . import cli
  File "/home/bgautam/webshop/.venv/lib/python3.10/site-packages/flask/cli.py", line 17, in <module>
    from .helpers import get_debug_flag
  File "/home/bgautam/webshop/.venv/lib/python3.10/site-packages/flask/helpers.py", line 14, in <module>
    from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/home/bgautam/webshop/.venv/lib/python3.10/site-packages/werkzeug/urls.py)

QuickFix: Uninstall the WerkZeug and then install WerkZeug version 2.

pip uninstall Werkzeug
pip install Werkzeug==2.2.2

BiplabG avatar Dec 18 '24 15:12 BiplabG

Thanks, this worked for me.

ruhanaazam avatar Jan 06 '25 19:01 ruhanaazam