jrieke / streamlit-analytics

👀 Track & visualize user interactions with your streamlit app
MIT License
262 stars 48 forks source link

ReportThread - ModuleNotFoundError #14

Closed trsavi closed 1 year ago

trsavi commented 2 years ago

ReportThread seems to not be working with new version of streamlit (1.5.0.), I got ModuleNotFoundError. When I changed the source code in session_state.py and commented lines for importing report_thread and also disregarded ctx (ctx = ReportThread.get_report_ctx()) variable throughout the script I avoided error on local machine and everything worked fine (I could see basic statistics) but when I deploy it onto streamlit share framework error appeared once again. Any thoughts on this?

chanansh commented 2 years ago

please pull request the necessary changes so we can all enjoy the correction.

chanansh commented 2 years ago

@jrieke please help correct this.

riyadparvez commented 2 years ago

An easy fix to this has already been posted. https://discuss.streamlit.io/t/modulenotfounderror-no-module-named-streamlit-report-thread/20983/7?u=riyad_parvez

yanirs commented 2 years ago

This will be fixed by #16 or #12.

Until one of the PRs is merged, you can install one of the forks, e.g., pip install git+https://github.com/yanirs/streamlit-analytics.

harishkashyap commented 2 years ago

+1 on this. Same issue on sample code with latest python.

alaturqua commented 2 years ago

Any plans to fix this soon?

corticalstack commented 2 years ago

+1, same issue

Edit: Found suggestion by Velicanu in link below resolved:

https://discuss.streamlit.io/t/module-not-found-reportthread/5657/6

TTRh commented 2 years ago

any news about this one ? i saw there is a more recent attempt also here: https://github.com/jrieke/streamlit-analytics/pull/18

standard-outlier commented 2 years ago

This will be fixed by #16 or #12.

Until one of the PRs is merged, you can install one of the forks, e.g., pip install git+https://github.com/yanirs/streamlit-analytics.

Thanks I have tested you code, it works in streamlit 1.4, but getting another import error in 1.8

franasal commented 2 years ago

@yanirs I tried with your repo but unfortunately, it didn't work. I had to add these modifications to make it work for streamlit 1.8:

https://github.com/jrieke/streamlit-analytics/compare/main...franasal:streamlit-analytics:main and added it to my requirements.txt:

git+https://github.com/franasal/streamlit-analytics

yanirs commented 2 years ago

Yeah, looks like this project isn't being maintained so I'm not using it. It'll probably break again with new Streamlit versions, unless it's actively maintained.

fredzannarbor commented 2 years ago

This should either be supported, or be available by default as part of all versions of Streamlit.

jrieke commented 1 year ago

Hey, sorry for the super long delay. I never had time to come around to this. I changed the implementation to work with st.session_state now, so it should be a lot more stable. Check out release 0.4.1, it's tested with Streamlit 1.13.0. (Note that the minimum Streamlit version is now 0.84.0).