Hi Streamlit team,
We’ve been facing a recurring issue with the following error when running our multipage Streamlit app locally:
streamlit.errors.StreamlitAPIException: Cannot infer page title for Callable. Set the title= keyword argument.
Traceback:
File “C:\Users\USER\po_agent_os.venv\lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py”, line 121, in exec_func_with_error_handling
result = func()
File “C:\Users\USER\po_agent_os.venv\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py”, line 643, in code_to_exec
_mpa_v1(self._main_script_path)
File “C:\Users\USER\po_agent_os.venv\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py”, line 148, in _mpa_v1
main_page = StreamlitPage(MAIN_SCRIPT_PATH, default=True)
File “C:\Users\USER\po_agent_os.venv\lib\site-packages\streamlit\navigation\page.py”, line 202, in init
raise StreamlitAPIException
1. Are you running your app locally or is it deployed?
We’re running it locally on Windows 11 using the Streamlit CLI.
2. If your app is deployed:
Not deployed yet.
3. GitHub repository
Currently private, but I can provide code snippets if needed.
4. Full error message
See the full traceback above.
5. Streamlit and Python versions
- Streamlit version:
1.33.0
- Python version:
3.11.x
Context and What We’ve Tried
- We’re using Streamlit’s native multipage setup:
- The main file is
streamlit_ui/app.py
- Pages are in
streamlit_ui/pages/0_Login.py
,1_PO_Dashboard.py
, etc.
- The main file is
- Each page has
st.set_page_config(page_title=..., layout="wide")
correctly set at the top. - No unnamed lambdas or dynamic page registration.
- File and directory structure is clean and alphabetical (
0_
,1_
, etc.). - We’ve confirmed there are no hidden
.py
files insidepages/
. - We ensured
app.py
is run as:
streamlit run streamlit_ui/app.py
Despite all of this, the error still occurs sporadically when:
- Rapidly switching pages via sidebar
- Clicking buttons that trigger
st.rerun()
or manipulatest.session_state
We tried all of the following:
- Reordering
st.set_page_config()
to be the very first line - Wrapping
app.py
in amain()
function - Clearing the cache with
streamlit cache clear
- Downgrading to
streamlit==1.30.0
(still occurred occasionally) - Removing
__pycache__
folders - Verifying UUIDs and any external data calls had no influence
Request
Is this a known bug in the page stack / navigation system?
We’d love help understanding:
- What might be causing Streamlit to treat our main script as a “Callable”?
- Any workarounds or patches?
Thank you so much! Happy to share more logs or setup if needed.
Best,
Zach