{"record":{"id":"78df5bffe510f8e0","repo":"PaddlePaddle/PaddleOCR","slug":"install-module-name-failed-please-install-manua","errorCode":null,"errorMessage":"Install {module_name} failed, please install manually","messagePattern":"Install (.+?) failed, please install manually","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"ppocr/utils/utility.py","lineNumber":195,"sourceCode":"    paddle.seed(seed)\n\n\ndef check_install(module_name, install_name):\n    spec = importlib.util.find_spec(module_name)\n    if spec is None:\n        print(f\"Warning! The {module_name} module is NOT installed\")\n        print(\n            f\"Try install {module_name} module automatically. You can also try to install manually by pip install {install_name}.\"\n        )\n        python = sys.executable\n        try:\n            subprocess.check_call(\n                [python, \"-m\", \"pip\", \"install\", install_name],\n                stdout=subprocess.DEVNULL,\n            )\n            print(f\"The {module_name} module is now installed\")\n        except subprocess.CalledProcessError as exc:\n            raise Exception(f\"Install {module_name} failed, please install manually\")\n    else:\n        print(f\"{module_name} has been installed.\")\n\n\nclass AverageMeter:\n    def __init__(self):\n        self.reset()\n\n    def reset(self):\n        \"\"\"reset\"\"\"\n        self.val = 0\n        self.avg = 0\n        self.sum = 0\n        self.count = 0\n\n    def update(self, val, n=1):\n        \"\"\"update\"\"\"\n        self.val = val","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/ppocr/utils/utility.py#L177-L213","documentation":"Exception from ppocr/utils/utility.py's auto-install helper: the requested module was missing, the helper attempted 'python -m pip install <install_name>' via subprocess, pip returned non-zero, and the CalledProcessError is re-raised as a plain Exception telling you to install manually. Common underlying pip failures: no network/proxy, incompatible version constraints, or no matching wheel for the Python version.","triggerScenarios":"Using a utility that lazily needs an optional module (the helper prints 'Warning! The X module is NOT installed' first) in an environment where pip cannot fetch or build the package.","commonSituations":"Offline or proxied environments where implicit pip installs fail; Python versions for which no wheel exists and source build fails; read-only site-packages without pip install --user fallback.","solutions":["Install the package manually in the same environment as the printed install_name (the log line above the error shows the exact pip command to copy).","Fix pip connectivity first (proxy env vars, index URL) if the install failed for network reasons.","For no-wheel situations, pin a Python version supported by the package or install a prebuilt wheel file directly."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"import importlib.util\n\ndef module_present(name) -> bool:\n    return importlib.util.find_spec(name) is not None\n\nif not module_present(module_name):\n    raise SystemExit(f\"{module_name} is required. Install it with: pip install {install_name}\")","typeGuard":"def is_module_installed(name) -> bool:\n    import importlib.util\n    return importlib.util.find_spec(name) is not None","tryCatchPattern":"try:\n    auto_install_or_run(module_name, install_name)\nexcept Exception:\n    # explicit manual install with visible output instead of the silent auto-installer\n    subprocess.check_call([sys.executable, '-m', 'pip', 'install', install_name])\n    auto_install_or_run(module_name, install_name)","preventionTips":["Install optional dependencies up front in the environment rather than relying on runtime auto-install.","Run pip with a visible terminal (no stdout=DEVNULL) when debugging install failures to see pip's real error.","Pin package versions in requirements to avoid no-wheel resolution failures on newer Python versions."],"tags":["dependency","pip","environment","installation"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}