streamlit/streamlit · error · FileNotFoundError

Theme file not found: {file_path_or_url}

Error message

Theme file not found: {file_path_or_url}

What it means

Error "Theme file not found: {file_path_or_url}" thrown in streamlit/streamlit.

Source

Thrown at lib/streamlit/config_util.py:605

    file_path_or_url: str, config_options_template: dict[str, ConfigOption]
) -> dict[str, Any]:
    """
    Load and parse a theme TOML file from a local path or URL.

    Handles raising errors when a file cannot be found, read, parsed,
    or contains invalid theme options.

    Otherwise returns the parsed TOML content as a dictionary.
    """

    def _raise_missing_toml() -> None:
        raise StreamlitInvalidThemeError(
            "The 'toml' package is required to load theme files. "
            "Please install it with 'pip install toml'."
        )

    def _raise_file_not_found() -> None:
        raise FileNotFoundError(f"Theme file not found: {file_path_or_url}")

    def _raise_missing_theme_section() -> None:
        raise StreamlitInvalidThemeSectionError(
            f"Theme file {file_path_or_url} must contain a [theme] section"
        )

    def _raise_file_too_large() -> None:
        content_size = len(content.encode("utf-8"))
        raise StreamlitInvalidThemeError(
            f"Theme file {file_path_or_url} is too large ({content_size:,} bytes). "
            f"Maximum allowed size is {_MAX_THEME_FILE_SIZE_BYTES:,} bytes (1MB). "
            f"Theme files should contain only configuration options, not large data."
        )

    try:
        import toml
    except ImportError:
        _raise_missing_toml()

View on GitHub (pinned to 202661fc55)

When it happens

Trigger: Thrown at lib/streamlit/config_util.py:605 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/b09c0e4e8d26ea41. Report an issue: GitHub.