Streamlit==1.18.0 and altair== 4.0 incompatibility

Hey everyone,
I have been trying to deploy my streamlit app with GCP.
I encountered the error : KeyError: 'st.session_state has no key “authentication_status”. Did you forget to initialize it?
Here is the concerned code snippet :
name,authentication_status, username = authenticator.login(‘Login’, ‘main’)
if authentication_status:
authenticator.logout(‘Logout’, ‘main’)
if username in [‘username1’,‘username2’]:
elif authentication_status == False:
st.error(‘Username/password is incorrect’)
elif authentication_status == None:
st.warning(‘Please enter your username and password’)
I changed the version of streamlit to 1.18.0 following the recommendations on previous discussions but it has then raised the error : "from altair.vegalite.v4.api import Chart ModuleNotFoundError: No module named ‘altair.vegalite.v4’ "
If you have any clue on how to solve this let me know

Yeah, it wasn’t compatible back then but now with Streamlit 1.24.1 and up (latest version being Streamlit 1.25.0 you can have altair 4.2.2.

Adding this to requirements.txt should fix the altair issue for older versions of streamlit ModuleNotFoundError: No module named 'altair.vegalite.v4' - #6 by Franky1

I have already tried this and It didn’t fix it.
In the end I still get the following error : KeyError: 'st.session_state has no key “authentication_status”. Did you forget to initialize it?

Sorry, it sounds like that’s a but with GitHub - mkhorasani/Streamlit-Authenticator: A secure authentication module to validate user credentials in a Streamlit application. – have you tried looking at the issues in that repo, and seeing if people have suggested fixes?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.