{"record":{"id":"903565625b26cf3a","repo":"pola-rs/polars","slug":"deltalake-is-not-installed-please-run-pip-instal","errorCode":null,"errorMessage":"deltalake is not installed\n\nPlease run: pip install deltalake","messagePattern":"deltalake is not installed\n\nPlease run: pip install deltalake","errorType":"exception","errorClass":"ModuleNotFoundError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/io/delta/_utils.py","lineNumber":95,"sourceCode":"            version=version,\n            storage_options=storage_options,\n            **delta_table_options,\n        )\n    else:\n        dl_tbl = deltalake.DeltaTable(\n            table_path,\n            storage_options=storage_options,\n            **delta_table_options,\n        )\n        dl_tbl.load_as_version(version)\n\n    return dl_tbl\n\n\ndef _check_if_delta_available() -> None:\n    if not _DELTALAKE_AVAILABLE:\n        msg = \"deltalake is not installed\\n\\nPlease run: pip install deltalake\"\n        raise ModuleNotFoundError(msg)\n\n\ndef _check_for_unsupported_types(dtypes: list[DataType]) -> None:\n    schema_dtypes = unpack_dtypes(*dtypes)\n    unsupported_types = {Time, Null}\n    # Note that this overlap check does NOT work correctly for Categorical, so\n    # if Categorical is added back to unsupported_types a different check will\n    # need to be used.\n\n    if overlap := schema_dtypes & unsupported_types:\n        msg = f\"dataframe contains unsupported data types: {overlap!r}\"\n        raise TypeError(msg)\n\n\ndef _extract_table_statistics_from_delta_add_actions(\n    add_actions_df: DataFrame,\n    *,\n    filter_columns: list[str],","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/io/delta/_utils.py#L77-L113","documentation":"Raised as ModuleNotFoundError by the delta helpers when the optional deltalake package is not installed. All delta-lake functionality in polars (scan_delta, read_delta, write_delta, DeltaTable handling) is gated on this dependency, and the message includes the install command.","triggerScenarios":"Calling pl.scan_delta / pl.read_delta / pl.write_delta in an environment where deltalake is not installed (polars does not ship it by default).","commonSituations":"Fresh environments or slim Docker images with plain pip install polars; CI caches that drop optional extras; adding polars delta code to a service that never needed delta before.","solutions":["Install the dependency: pip install deltalake","Or add the extra when installing polars if your workflow documents one (e.g. pip install 'polars[delta]' where supported)","Pin deltalake>=1.4.2 if you also need deletion-vector reads"],"exampleFix":"# before: ModuleNotFoundError: deltalake is not installed\npl.scan_delta(\"./delta_table\").collect()\n\n# after\npip install deltalake","handlingStrategy":"validation","validationCode":"import importlib.util\n\nif importlib.util.find_spec(\"deltalake\") is None:\n    raise ModuleNotFoundError(\"pip install deltalake before running delta pipelines\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add deltalake to project dependencies wherever delta code is imported","Fail fast on find_spec('deltalake') at app startup in slim containers","Document optional delta dependencies in the service README"],"tags":["delta-lake","dependency","module-not-found"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}