Streamlit authenticator-KeyError

:rotating_light: Before clicking “Create Topic”, please make sure your post includes the following information (otherwise, the post will be locked). :rotating_light:

  1. Are you running your app locally or is it deployed?
    The app is run locally

  2. Share the Streamlit-latest version and Python version:3.10.

with open('./login_credentials.yaml') as file:
    config = yaml.load(file, Loader=SafeLoader)

authenticator = stauth.Authenticate(

with open('./login_credentials.yaml', 'w') as file:
    yaml.dump(config, file, default_flow_style=False)


if st.session_state['authentication_status'] is False:
    st.error("Username/password is incorrect")

if st.session_state['authentication_status'] is None:
    st.warning("Please enter your username and password")

if st.session_state['authentication_status']:
    # plot function
    # @st.cache_data
    st.write(f'Welcome *{st.session_state["name"]}*')
    def plot(x,y,z):
      my code continues

I am trying to create a login authentication page for a streamlit application using streamlit authenticator, after which the user will be taken to the main app if login is successful but I keep getting this error

Put that code at the bottom of the page.

1 Like

@ferdy do you mean the bottom after the main application body. Thanks

There is some progress on this issue.

We better try the latest version.

okay. Thanks