{"record":{"id":"08be7dd4a0fbfb21","repo":"pola-rs/polars","slug":"required-package-module-name-not-found-please","errorCode":null,"errorMessage":"required package '{module_name}' not found.\nPlease install using the command `pip install {module_root}`.","messagePattern":"required package '(.+?)' not found\\.\nPlease install using the command `pip install (.+?)`\\.","errorType":"exception","errorClass":"ModuleNotFoundError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/_dependencies.py","lineNumber":298,"sourceCode":"    ...     err_prefix=\"super-important package\",\n    ... )  # doctest: +SKIP\n    ImportError: super-important package 'definitely_a_real_module' not installed.\n    Please install it using the command `pip install definitely_a_real_module`.\n    \"\"\"\n    from polars._utils.various import parse_version\n    from polars.exceptions import ModuleUpgradeRequiredError\n\n    module_root = module_name.split(\".\", 1)[0]\n    try:\n        module = import_module(module_name)\n    except ImportError:\n        prefix = f\"{err_prefix.strip(' ')} \" if err_prefix else \"\"\n        suffix = f\" {err_suffix.strip(' ')}\" if err_suffix else \"\"\n        err_message = f\"{prefix}'{module_name}'{suffix}.\\n\" + (\n            install_message\n            or f\"Please install using the command `pip install {module_root}`.\"\n        )\n        raise ModuleNotFoundError(err_message) from None\n\n    if min_version:\n        min_version = parse_version(min_version)\n        mod_version = parse_version(module.__version__)\n        if mod_version < min_version:\n            msg = (\n                f\"{min_err_prefix} {module_root} \"\n                f\"{'.'.join(str(v) for v in min_version)} or higher\"\n                f\" (found {'.'.join(str(v) for v in mod_version)})\"\n            )\n            raise ModuleUpgradeRequiredError(msg)\n\n    return module\n\n\n__all__ = [\n    # lazy-load rarely-used/heavy builtins (for fast startup)\n    \"dataclasses\",","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/py-polars/src/polars/_dependencies.py#L280-L316","documentation":"ModuleNotFoundError raised by the lazy-import helper when import_module({module_name}) raised ImportError: the optional package required by the calling API is missing from the environment. The message composes an optional err_prefix, the module name, and a pip install hint naming the module root package.","triggerScenarios":"A required third-party package is missing at runtime.","commonSituations":"See trigger scenarios.","solutions":["Install the required package with the printed command: pip install <module_root>."],"exampleFix":"pip install <module_root>","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b5d73fd00236295624374b075d16b1fe6ec6df9","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}