idcrook / shairport-sync-mqtt-display

Display currently playing info, with remote control, using shairport-sync's MQTT support
MIT License
31 stars 6 forks source link

Flask app won't start #49

Closed nigelewan closed 1 year ago

nigelewan commented 1 year ago

I receive the following error when attempting to launch app.py.

Traceback (most recent call last):
  File "/home/pi/projects/shairport-sync-mqtt-display/python-flask-socketio-server/app.py", line 15, in <module>
    from flask_socketio import SocketIO
  File "/home/pi/projects/shairport-sync-mqtt-display/python-flask-socketio-server/.venv/lib/python3.9/site-packages/flask_socketio/__init__.py", line 19, in <module>
    from flask import _request_ctx_stack, has_request_context, json as flask_json
ImportError: cannot import name '_request_ctx_stack' from 'flask' (/home/pi/projects/shairport-sync-mqtt-display/python-flask-socketio-server/.venv/lib/python3.9/site-packages/flask/__init__.py)

Any help (or pointers in the right direction) would be appreciated.

idcrook commented 1 year ago

Haven't looked further yet, but guessing this could be related to recent Flask 3.x (3.0) release getting pulled in.

Flask-2.3.2 is version I see in my working systems.

idcrook commented 1 year ago

I reproduced this issue. And determined it is indeed the Flask version. I updated requirements.txt so that it doesn't pull in the 3.x for flask and it works as expected. I'll push a fix soon.

idcrook commented 1 year ago

To get this fix, you'll want to pull in the latest change, and delete the .venv directory. then re-"install" as before (which will recreate the .venv directory with the updated requirements.txt