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.