{"record":{"id":"614f333b468ed92d","repo":"pola-rs/polars","slug":"no-workbook-found-at-path-src-r","errorCode":null,"errorMessage":"no workbook found at path {src!r}","messagePattern":"no workbook found at path (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/io/spreadsheet/functions.py","lineNumber":74,"sourceCode":"    read_multiple_workbooks = True\n    sources: list[Any] = []\n\n    if isinstance(source, memoryview):\n        source = source.tobytes()\n    if not isinstance(source, Sequence) or isinstance(source, (bytes, str)):\n        read_multiple_workbooks = False\n        source = [source]  # type: ignore[assignment]\n\n    for src in source:  # type: ignore[union-attr]\n        if isinstance(src, (str, os.PathLike)) and not Path(src).exists():\n            src = os.path.expanduser(str(src))  # noqa: PTH111\n            if looks_like_url(src):\n                sources.append(src)\n                continue\n            sources.extend(files := glob(src, recursive=True))  # noqa: PTH207\n            if not files:\n                msg = f\"no workbook found at path {src!r}\"\n                raise FileNotFoundError(msg)\n            read_multiple_workbooks = True\n        else:\n            if isinstance(src, os.PathLike):\n                src = str(src)\n            sources.append(src)\n\n    return sources, read_multiple_workbooks\n\n\ndef _standardize_duplicates(s: str) -> str:\n    \"\"\"Standardize columns with '_duplicated_n' names.\"\"\"\n    return re.sub(r\"_duplicated_(\\d+)\", repl=r\"\\1\", string=s)\n\n\ndef _unpack_read_results(\n    frames: list[pl.DataFrame] | list[dict[str, pl.DataFrame]],\n    *,\n    read_multiple_workbooks: bool,","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/io/spreadsheet/functions.py#L56-L92","documentation":"Source-path check in read_excel/read_ods source normalization: a str/PathLike source does not exist on disk even after expanduser, and it does not look like a URL, so no workbook can be opened at that path — typically a typo or wrong relative path.","triggerScenarios":"pl.read_excel('data/xlsx') with a typo'd path, a glob like 'data/*.xlsx' matching nothing, or the file not yet written/downloaded.","commonSituations":"Wrong working directory, glob pattern with wrong extension case (.XLSX vs .xlsx), remote paths that aren't URLs, files removed between existence check and read.","solutions":["Verify the file exists at the exact path (os.path.exists / ls) and fix typos.","Loosen or correct the glob pattern and check the extension matches the files on disk.","If the source is remote, ensure it uses a URL scheme (http(s)://) so it is treated as a URL rather than a local path."],"exampleFix":"// before\npl.read_excel('reports/*.xlsx')  # no matches\n// after\nimport glob\nassert glob.glob('reports/*.xlsx'), 'no workbook files present'\npl.read_excel('reports/*.xlsx')","handlingStrategy":"validation","validationCode":"from glob import glob\nfrom os.path import isfile\nmatches = glob(pattern, recursive=True)\nassert matches, f'no workbook matches {pattern}'","typeGuard":null,"tryCatchPattern":"try:\n    df = pl.read_excel(path)\nexcept FileNotFoundError:\n    raise RuntimeError(f'check path: {path!r} does not exist') from None","preventionTips":["Check file existence/pattern matches before reading","Print resolved glob results during debugging","Use absolute paths and confirm the working directory"],"tags":["excel","polars","file-not-found","glob"],"backgroundTag":"file-not-found","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}