Closed code49 closed 2 years ago
After some more digging, it seems like these changes would also introduce issues around getting the sessionstate for a specific session_id (perhaps the functionality of Server
has changed?); working on potential solutions now.
As a side note, this seems to be the part of the same-ish issue as #43 , so perhaps the fix to that will fix these import path issues as well.
Yes, the way the streamlit server imports worked before was that it used a hack to obtain a state, which is now deprecated. The Server class no longer has a method called get_current
, which breaks Hydra anyway. See this forum post on Streamlit 1.12 breaking functionality: https://discuss.streamlit.io/t/streamlit-script-run-context-gone-with-1-8/23526/5. Fishing the Server instance from the GC is hacky.
I've been working on refactoring Hydralit to use the built-in session_state
, which removes the need for the sessionstate.py
file entirely.
Update:
I've put in a PR for a rewrite that works with Streamlit >=1.12. You can check it out at #45. I've only tested it with hydralit_example
though.
please update to the latest package (1.0.14), as a fix has been created and deployed.
pip install -U hydralit
Thanks very much for your hard work saikumarmk!
Trying to build a website using Hydralit, and encountered
ModuleNotFound
errors immediately upon importing the library.It seems like at some point Streamlit changed around their code schema; changing two lines in
sessionstate.py
seemed to do the trick:and
I'm pretty new to Streamlit/Hydralit, but hopefully these changes won't break anything else? Seems to be working just fine from the testing I've been doing.