streamlit/streamlit · error · StreamlitPageNotFoundError

StreamlitPageNotFoundError

Error message

StreamlitPageNotFoundError

What it means

Error "StreamlitPageNotFoundError" thrown in streamlit/streamlit.

Source

Thrown at lib/streamlit/commands/execution_control.py:325

                "Use st.page_link instead to create a link to external pages."
            )
        _validate_registered_page(page)
        page_script_hash = page._script_hash
    else:
        # Convert Path to string if necessary
        if isinstance(page, Path):
            page = str(page)

        main_script_directory = get_main_script_directory(ctx.main_script_path)
        requested_page = os.path.realpath(
            normalize_path_join(main_script_directory, page)
        )
        all_app_pages = ctx.pages_manager.get_pages().values()

        matched_pages = [p for p in all_app_pages if p["script_path"] == requested_page]

        if len(matched_pages) == 0:
            raise StreamlitPageNotFoundError(
                page=page,
                main_script_directory=main_script_directory,
                uses_pages_directory=bool(PagesManager.uses_pages_directory),
            )

        page_script_hash = matched_pages[0]["page_script_hash"]

    # Reset query params (with exception of embed) and optionally apply overrides.
    with ctx.session_state.query_params() as qp:
        _set_query_params_for_switch(qp, query_params)

    # Safeguard: sleep longer than the flush interval to ensure at least one
    # complete flush cycle delivers the query params before the rerun clears
    # outstanding messages. Sleep is placed after the with block to release
    # the session state lock first.
    time.sleep(2 * MESSAGE_FLUSH_INTERVAL_SECS)

    ctx.script_requests.request_rerun(

View on GitHub (pinned to 202661fc55)

When it happens

Trigger: Thrown at lib/streamlit/commands/execution_control.py:325 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of streamlit/streamlit@202661fc55 (2026-08-26). Data as JSON: /api/errors/67b98c878a1ca369. Report an issue: GitHub.