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ā€™]:
main()
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

@caps_j
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

Hi,
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.