Bcrypt is not working in my app

Hi,

I am trying to create a simple login system in streamlit. It works fine on my computer but when I upload it to github I get this error:

cannot import name ‘_bcrypt’ from partially initialized module ‘bcrypt’ (most likely due to a circular import)

This is the code I used to create the login system:

authenticator = stauth.Authenticate(config["credentials"], config['cookie']['name'], config['cookie']['key'], config['cookie']['expiry_days'], config['preauthorized'])
name, authentication_status, username = authenticator.login('Login')
if st.session_state["authentication_status"]:
    authenticator.logout('Logout', 'sidebar')
    st.sidebar.write(f'Welcome *{st.session_state["name"]}*')
    side_bar_menu()

elif st.session_state["authentication_status"] is False:
    st.error('Username/password is incorrect')
elif st.session_state["authentication_status"] is None:
    st.warning('Please enter your username and password')

Any help would be appreciated.

Hey @Mystery-Walker,

Would you be able to share a more complete code snippet and a link to your GitHub repo? Since this seems like an import issue we will probably need to see what dependencies are being installed and imported.

Hi @Caroline .
Here is a link to the repo

Don’t worry I have managed to fix the problem. It was the dependencies.

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