arnaudmiribel / streamlit-extras

Discover, try, install and share Streamlit re-usable bits we call "extras"!
https://extras.streamlit.app
Apache License 2.0
754 stars 126 forks source link

Not working with the new release of Streamlit 1.14.0 #59

Closed LorenzoVela closed 1 year ago

LorenzoVela commented 1 year ago

There is a problem with the Rerun function. It has been renamed in the new version and it's raising problems with the switch_page functionality (That has not been updated in the new version of streamlit-extras). Is there any plan to fix this issue? Thank you.

[Workaround for the moment is to downgrade streamlit at 1.13.0 and keep working with that one]

blackary commented 1 year ago

Are you using the latest version of streamlit-extras? 0.2.0 was explicitly updated to support streamlit 1.14.0 -- could you please check if you have 0.2.0 and let me know if it still doesn't work with streamlit 1.14.0?

LorenzoVela commented 1 year ago

Yes, I confirm. From streamlit-extras switch page function are visible these 2 imports (I'm talking about the 2 "rerun")

image

But in streamlit 1.14.0 init file there is no trace of these function. They've been renamed or replaced:

image

This is the error I'm getting:

image

Don't know if I'm missing something huge but I should've updated everything correctly. Can you may also check? Thank You

blackary commented 1 year ago

@LorenzoVela It appears from the stack trace in the error that you're using an old version of streamlit-extras, since it's still trying to import _RerunData and _RerunException from streamlit

image

As your first screenshot of the source code of the switch_page function shows, these imports have been changed to be imports from streamlit.runtime.scriptrunner instead, to be compatible with 1.14.0.

You can see this live at https://extras.streamlit.app/Switch%20page%20function, which is currently running on streamlit 1.14.0.

Can you please ensure that the version of streamlit-extras that is actually being used in your streamlit app (specifically, whichever version of streamlit-extras is installed in the same conda environment that streamlit is installed in) is 0.2.0?

LorenzoVela commented 1 year ago

Hi, I've just downloaded the streamlit-extras package

image

And if I try to download streamlit-extras

image

LorenzoVela commented 1 year ago

Checking in your github code the switch page code still try to import RerunData and RerunException so there's something wrong here in github too if you're saying that these are the old imports. Thank You anyway for helping :)

Regards, Lorenzo

arnaudmiribel commented 1 year ago

Checking in your github code the switch page code still try to import RerunData and RerunException so there's something wrong here in github too if you're saying that these are the old imports.

@LorenzoVela if you look at the main branch of streamlit-extras, the latest release of the switch_page extra does use RerunData and RerunException which are compatible with streamlit==1.14.0 -- see code here after this commit from @blackary. Your screenshot shows an exception being thrown for the usage of _RerunData (versus RerunData) which clearly shows that it's not using latest versions.

Would recommend that you make sure to activate your conda environment and upgrade both streamlit and streamlit-extras

conda activate && pip install streamlit --upgrade && pip install streamlit-extras --upgrade