Streamlit native multipage support not working

Summary

I followed the streamlit documentation on implementing a multipage app natively and structured my streamlit project directory as such.

image

main_page.py :

import streamlit as st

st.markdown("# Main page 🎈")
st.sidebar.markdown("# Main page 🎈")


pages/page_2.py :

import streamlit as st

st.markdown("# Page 2 ❄️")
st.sidebar.markdown("# Page 2 ❄️")

pages/page_3.py :

import streamlit as st

st.markdown("# Page 3 πŸŽ‰")
st.sidebar.markdown("# Page 3 πŸŽ‰")

The output :

May I know what is wrong here ? Thanks.

Hi @Huvinesh-Rajendran-1, welcome to the forum! :wave: :balloon:

From the screenshots you’ve shared, it looks like your app is structured correctly :thinking: What version of Streamlit is it using? You can check via streamlit version in the terminal or st.write(st.__version__) in main_page.py.

Support for multipage apps was added in version 1.10.0, so I’d start by confirming the version is >=1.10.0.

Yeah the issue was with the version. I installed streamlit using conda, seems like conda has support only upto version 1.9.0 as of now. I reinstalled it using pip, thanks.

Hmm, I don’t think that’s the case (?) The latest v1.19.0 and prior versions are available in the conda-forge channel:

https://anaconda.org/conda-forge/streamlit/files?version=1.19.0

Ah I see, I checked, there was some issues with one of the libraries during installation hence it installed version 1.9.0 for me. I checked and installed back to 1.19.0. Thanks for the heads up.

1 Like

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