Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python module versions to requirements.txt #13

Open
keithcallenberg opened this issue Jan 26, 2022 · 2 comments
Open

Add python module versions to requirements.txt #13

keithcallenberg opened this issue Jan 26, 2022 · 2 comments

Comments

@keithcallenberg
Copy link

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
Copy link

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants