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?