Multi page navigation component error

I had been using the navigation component as defined here:

However, recently my app has been generating an error with this navigation configuration:

import streamlit as st

st.set_page_config(page_title="Home", layout="wide")
pages = {
    "OPS Dashboard" : [
        st.Page("Home.py", title="Home"),
        st.Page("Uptim.py", title="CKAN")
    ],
}

pg = st.navigation(pages)
pg.run()

Error:
AttributeError: ‘StreamlitPage’ object has no attribute ‘_default’

Its running locally and used to be working just fine. I am using streamlit version 1.36 and have been using it since the beginning of this app.

Is this a known bug or just me being an idiot?

Is this code in your app.py or in your Home.py?

Its in my main.py.
Everything works fine now as long as i just run it with the streamlit run main.py command.

When i run the file with Python it generates an error.

In order to run the application in needs the Streamlit run main.py invocation. That’s how the server starts.

1 Like

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