I have created a streamlit app with multiple pages where I used Sessionstate. The problem is, buttons are displayed multiple times at random places. Actually they doesn’t look like original buttons. The buttons are also printed in pages where they are not used.
Undesirable behavior:
Found RerunException causing the error
session.request_rerun() also exhibit same problem.
Welcome to the Streamlit Community! If I understand your question correctly, on the main part of the web app (not in the side bar) your getting print outs of the valid and not valid over and over again and you want to get rid of these?
I think a minimal working example of your code would be very helpful for bug hunting the culprit of all the unwanted statements !
Based on your screenshot my initial guess was that your script was simply taking too long to run, in which case the faded buttons are working as intended. But I don’t see the “running man” animation on the top right, so that theory can’t be right. Something bigger must be afoot! Or did you hide that animation somehow?
Found RerunException causing the error
session.request_rerun() also exhibit same problem.
Are you saying this_session.request_rerun() is the source of the problem? What makes you think so?
Found there is a problem in caching spacy model.
Does this mean you found the issue? If so, what was it? I’d love to understand it!
Otherwise, if you’re still experiencing this issue, can you provide an even smaller example where the bug can be seen?
There’s so much going on in the code above, it’s hard to even get it running
For starters, I don’t know where you got the session_state code. So I tried removing everything that seemed unrelated to the bug itself and ended up with this:
import streamlit as st
for i in range(10):
st.write(f"This is iteration {i}")
valid = st.button("VALID", key=f'VALID_{i}')
not_valid = st.button("NOT VALID", key=f'NOTVALID_{i}')
if valid or not_valid:
st.write("Updated")
if st.button("NEXT"):
st.experimental_rerun()
But when I run this code but I don’t see the buggy behavior