allenai / macaw

Multi-angle c(q)uestion answering
Apache License 2.0
458 stars 57 forks source link

Add python module versions to requirements.txt #13

Open keithcallenberg opened 2 years ago

keithcallenberg commented 2 years ago

The demo.py code imports from streamlit.hashing and streamlit.report_thread which are both deprecated and have been refactored in the latest versions of streamlit. This caused me to get e.g. ModuleNotFoundError: No module named 'streamlit.hashing' when trying to run the demo.

Downgrading to streamlit==1.0.0 resolved this for me.

Adding version information to the requirements.txt would solve this problem.

glecorve commented 2 years ago

Same here.

Version 1.0.0 does not work neither for me but version 0.88.0 does. Alternatively, the import in demo.py can be fixed as follows:

#from streamlit.hashing import _CodeHasher
from streamlit.legacy_caching.hashing import _CodeHasher
keithcallenberg commented 2 years ago

If you go the fix-the-imports route with streamlit>=1.4.0, I think you'd also need to update this import. FROM: from streamlit.report_thread import get_report_ctx TO: from streamlit.script_run_context import get_script_run_ctx as get_report_ctx NB: I have not tested this.

References: https://discuss.streamlit.io/t/modulenotfounderror-no-module-named-streamlit-report-thread/20983/4 https://github.com/whitphx/streamlit-webrtc/blob/9420d0b78fa52527bc4c81f990d3896519e5d602/streamlit_webrtc/session_info.py#L2