{"record":{"id":"6bc56f688da46d39","repo":"docling-project/docling","slug":"nemotron-ocr-is-not-installed-install-the-optiona","errorCode":null,"errorMessage":"Nemotron OCR is not installed. Install the optional dependency via `pip install \"docling[feat-ocr-nemotron]\"` on Linux x86_64 with Python 3.12 and CUDA 13.x.","messagePattern":"Nemotron OCR is not installed\\. Install the optional dependency via `pip install \"docling\\[feat-ocr-nemotron\\]\"` on Linux x86_64 with Python 3\\.12 and CUDA 13\\.x\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"docling/models/stages/ocr/nemotron_ocr_model.py","lineNumber":135,"sourceCode":"            enabled=enabled,\n            artifacts_path=artifacts_path,\n            options=options,\n            accelerator_options=accelerator_options,\n        )\n        self.options: NemotronOcrOptions\n        # multiplier for 72 dpi; the default 3.0 == 216 dpi.\n        self.scale = self.options.scale\n\n        if self.enabled:\n            self.validate_runtime(accelerator_options=accelerator_options)\n            self._nemotron_checkpoint_files = []\n            try:\n                from nemotron_ocr.inference.pipeline import CHECKPOINT_FILES\n                from nemotron_ocr.inference.pipeline_v2 import NemotronOCRV2\n\n                self._nemotron_checkpoint_files = CHECKPOINT_FILES\n            except ImportError as exc:\n                raise ImportError(\n                    \"Nemotron OCR is not installed. Install the optional dependency \"\n                    'via `pip install \"docling[feat-ocr-nemotron]\"` on Linux x86_64 with '\n                    \"Python 3.12 and CUDA 13.x.\"\n                ) from exc\n\n            # Resolve the request language\n            language = resolve_nemotronocr_language(options.lang)\n\n            # Initialize the model\n            model_dir = self._resolve_model_dir(language, artifacts_path=artifacts_path)\n\n            self.reader = NemotronOCRV2(\n                model_dir=None if model_dir is None else str(model_dir),\n                lang=language,\n            )\n\n    @staticmethod\n    def _fail_runtime(message: str) -> None:","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/models/stages/ocr/nemotron_ocr_model.py#L117-L153","documentation":"The Nemotron OCR stage imports nemotron_ocr in __init__ when enabled; ImportError is raised when the optional package is absent, instructing you to install the `docling[feat-ocr-nemotron]` extra. The extra is constrained to Linux x86_64, Python 3.12, and CUDA 13.x because the upstream wheels only publish for that matrix.","triggerScenarios":"Enabling NemotronOcrOptions in an environment without the nemotron_ocr package — e.g. plain `pip install docling` on any platform, or even on Linux/Python 3.12 without the extra.","commonSituations":"Trying the newest OCR engine after a docling upgrade without adding the feature extra; attempting to use it on macOS/Windows or Python 3.10/3.11/3.13 where the dependency cannot install.","solutions":["On Linux x86_64 with Python 3.12 and CUDA 13.x, run `pip install \"docling[feat-ocr-nemotron]\"`.","If your platform/Python does not match, use a matching container/interpreter (e.g. python:3.12 Linux image with CUDA) or pick another OCR engine (Tesseract, EasyOCR, RapidOCR).","Confirm the import works: `python -c \"from nemotron_ocr.inference.pipeline_v2 import NemotronOCRV2\"`."],"exampleFix":"# before\noptions = NemotronOcrOptions()  # enabled without package -> ImportError\n\n# after (terminal, Linux x86_64 / Python 3.12 / CUDA 13.x)\npip install \"docling[feat-ocr-nemotron]\"","handlingStrategy":"validation","validationCode":"def nemotron_available() -> bool:\n    try:\n        from nemotron_ocr.inference.pipeline_v2 import NemotronOCRV2  # noqa: F401\n        return True\n    except ImportError:\n        return False","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install via the feature extra on a matching platform: `pip install \"docling[feat-ocr-nemotron]\"` (Linux x86_64, Python 3.12, CUDA 13.x).","Probe for nemotron_ocr import before selecting it as the OCR engine, and fall back to Tesseract/RapidOCR otherwise.","Bake the required platform matrix into a Dockerfile so the dependency cannot be missing."],"tags":["nemotron","ocr","import","dependencies","cuda"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}