StreamlitAPIException: Could not find page: `pages\**.py` when deploying into the Community Cloud

So i’m having a streamlit app that has switch_page components, while i run on local, the switch_page working just fine. But when i deploy the app into streamlit community cloud, the switch_page components couldn’t find the page.

here are the app im working on :

and here’s the github repos

error message on streamlit community cloud logs :

if button_pressed:                                                   
    st.switch_page("pages/chatbot.py")

StreamlitAPIException: Could not find page: pages\chatbot.py. Must be the file path relative to the main script, from the directory: chatbot-capstone. Only the main app file and files in the pages/ directory are supported.

things i have done :

  1. switch the slash into backslash

streamlit version:
latest

python version:
3.10

Looking forward for the answer, and Thanks in Advance.

Hey @202110715136,

Thanks for sharing this question! The GitHub repo you shared is private – could you make it public or share a minimal reproducible code snippet?

Also, I’m assuming from the code snippet that you’re using streamlit_extras for the page switching functionality, but Streamlit actually now supports this functionality natively – definitely recommend checking it out!

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