dgtlmoon / changedetection.io

The best and simplest free open source web page change detection, website watcher, restock monitor and notification service. Restock Monitor, change detection. Designed for simplicity - Simply monitor which websites had a text change for free. Free Open source web page change detection, Website defacement monitoring, Price change notification
https://changedetection.io
Apache License 2.0
17.3k stars 965 forks source link

[bug] PIP install - windows - 0.45.7 doesn't work after update - `ImportError: cannot import name 'url_decode' ` #1965

Closed curla92 closed 11 months ago

curla92 commented 11 months ago

Describe the bug Release v0.45.7 doesn't start after i have update. I tried to reinstall all but i have no success. I won't lose all data with a new installation, so please can you help me? thank y

C:\Users\Utente>changedetection.py Traceback (most recent call last): File "C:\Users\Utente\AppData\Local\Programs\Python\Python310\Scripts\changedetection.py", line 8, in <module> from changedetectionio import changedetection File "C:\Users\Utente\AppData\Local\Programs\Python\Python310\lib\site-packages\changedetectionio\__init__.py", line 8, in <module> from flask_login import current_user File "C:\Users\Utente\AppData\Local\Programs\Python\Python310\lib\site-packages\flask_login\__init__.py", line 12, in <module> from .login_manager import LoginManager File "C:\Users\Utente\AppData\Local\Programs\Python\Python310\lib\site-packages\flask_login\login_manager.py", line 35, in <module> from .utils import _create_identifier File "C:\Users\Utente\AppData\Local\Programs\Python\Python310\lib\site-packages\flask_login\utils.py", line 14, in <module> from werkzeug.urls import url_decode ImportError: cannot import name 'url_decode' from 'werkzeug.urls' (C:\Users\Utente\AppData\Local\Programs\Python\Python310\lib\site-packages\werkzeug\urls.py)

Version: 0.45.7

Os: Windows

Python Version: 3.10

Pip Version 23.3.1

dgtlmoon commented 11 months ago

@curla92 does this command fix it?

pip3 install Werkzeug==3.0.1 Flask-Login==0.6.3 Flask-WTF==1.2.1

then restart it

curla92 commented 11 months ago

@curla92 does this command fix it?

pip3 install Werkzeug==3.0.1 Flask-Login==0.6.3 Flask-WTF==1.2.1

then restart it

ohhh now it works thank y :)

nmaggioni commented 11 months ago

@dgtlmoon Sorry for the lack of context in #1961, I thought the issue would have been tracked properly elsewhere and indeed here we are! I intended to investigate further but didn't have the chance until moments ago.

I updated to the latest version through pip3 install --upgrade changedetection.io as usual, and upon restarting the service I got the same error mentioned here. Hacking in an older version of werkzeug through pip led me to that second error I posted, and rolling Flask back from 2.3.3 to 2.2.3 seemed to solved that issue in a pinch.

Here's a current freeze on the dedicated LXC container I'm running changedetection inside of:

# pip freeze | grep -Ei 'flask|werkzeug|changedetection'
changedetection.io==0.45.7
Flask==2.2.3
Flask-Compress==1.13
flask-expects-json==1.7.0
Flask-Login==0.6.2
flask-paginate==2022.1.8
Flask-RESTful==0.3.9
Flask-WTF==1.0.1
pytest-flask==1.2.0
Werkzeug==2.3.7

Removing all these packages (pip uninstall -yr <(pip freeze | grep -Ei 'flask|werkzeug|changedetection')) and reinstalling changedetection has just yielded me these dependencies:

# pip freeze | grep -Ei 'flask|werkzeug|changedetection'
changedetection.io==0.45.7
Flask==2.3.3
Flask-Compress==1.14
flask-expects-json==1.7.0
Flask-Login==0.6.3
flask-paginate==2023.10.24
Flask-RESTful==0.3.10
Flask-WTF==1.2.1
pytest-flask==1.3.0
Werkzeug==3.0.1

So yeah, it seems like the Flask-WTF version you just pinned solves the curlprit. Thanks!

dgtlmoon commented 11 months ago

ok great, i'll cook a new release soon

dgtlmoon commented 11 months ago

@curla92 @nmaggioni ok please try pip3 install --upgrade changedetection.io

that should resolve all problems for you

please let me know that works, it should bump it to 0.45.7.1

nmaggioni commented 11 months ago

@dgtlmoon Solution confirmed, thanks for the super fast release :+1: