{"record":{"id":"3f9da4c851d0f139","repo":"microsoft/markitdown","slug":"converter-recognized-the-input-as-a-potential-e-3f9da4","errorCode":null,"errorMessage":"{converter} recognized the input as a potential {extension} file, but the dependencies needed to read {extension} files have not been installed. To resolve this error, include the optional dependency [{feature}] or [all] when installing MarkItDown. For example:\n\n* pip install 'markitdown[{feature}]'\n* pip install 'markitdown[all]'\n* pip install 'markitdown[{feature}, ...]'\n* etc.","messagePattern":"(.+?) recognized the input as a potential (.+?) file, but the dependencies needed to read (.+?) files have not been installed\\. To resolve this error, include the optional dependency \\[(.+?)\\] or \\[all\\] when installing MarkItDown\\. For example:\n\n\\* pip install 'markitdown\\[(.+?)\\]'\n\\* pip install 'markitdown\\[all\\]'\n\\* pip install 'markitdown\\[(.+?), \\.\\.\\.\\]'\n\\* etc\\.","errorType":"exception","errorClass":"MissingDependencyException","httpStatus":null,"severity":"error","filePath":"packages/markitdown-ocr/src/markitdown_ocr/_pdf_converter_with_ocr.py","lineNumber":165,"sourceCode":"\n        if extension == \".pdf\":\n            return True\n\n        if mimetype.startswith(\"application/pdf\") or mimetype.startswith(\n            \"application/x-pdf\"\n        ):\n            return True\n\n        return False\n\n    def convert(\n        self,\n        file_stream: BinaryIO,\n        stream_info: StreamInfo,\n        **kwargs: Any,\n    ) -> DocumentConverterResult:\n        if _dependency_exc_info is not None:\n            raise MissingDependencyException(\n                MISSING_DEPENDENCY_MESSAGE.format(\n                    converter=type(self).__name__,\n                    extension=\".pdf\",\n                    feature=\"pdf\",\n                )\n            ) from _dependency_exc_info[1].with_traceback(\n                _dependency_exc_info[2]\n            )  # type: ignore[union-attr]\n\n        # Get OCR service if available (from kwargs or instance)\n        ocr_service: LLMVisionOCRService | None = (\n            kwargs.get(\"ocr_service\") or self.ocr_service\n        )\n\n        # Read PDF into BytesIO\n        file_stream.seek(0)\n        pdf_bytes = io.BytesIO(file_stream.read())\n","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/microsoft/markitdown/blob/fd239d5d2be43d9b68329730206b9312c7d5a388/packages/markitdown-ocr/src/markitdown_ocr/_pdf_converter_with_ocr.py#L147-L183","documentation":"The OCR-enabled PdfConverterWithOCR accepted a .pdf stream, but the pdf extra's dependencies (e.g. pdfminer.six) failed to import when the module loaded. The failure is captured at import time and re-raised as MissingDependencyException on every convert() call, formatted to name the missing extra. The original ImportError traceback is preserved as the exception cause.","triggerScenarios":"Converting a PDF via PdfConverterWithOCR (convert, convert_uri with a .pdf URL, or convert_stream) in an environment where the [pdf] extra was never installed.","commonSituations":"CI pipelines that pip install markitdown-ocr without extras, minimized containers that strip optional deps, or upgrading markitdown in an env where the old extras were pinned to an incompatible version and silently dropped.","solutions":["pip install 'markitdown[pdf]' (or 'markitdown[all]') into the runtime environment","Confirm the import works: python -c \"import pdfminer\" ","If the chained ImportError shows a different package, install that package directly or fix the broken install (pip install --force-reinstall)"],"exampleFix":"# before\npip install markitdown-ocr\nmd.convert(\"scan.pdf\")  # MissingDependencyException\n\n# after\npip install 'markitdown[pdf]'\nmd.convert(\"scan.pdf\")","handlingStrategy":"try-catch","validationCode":"import importlib.util\n\nassert importlib.util.find_spec(\"pdfminer\") is not None","typeGuard":null,"tryCatchPattern":"from markitdown import MissingDependencyException\n\ntry:\n    result = md.convert(pdf_stream, stream_info=StreamInfo(extension=\".pdf\"))\nexcept MissingDependencyException:\n    # fall back to non-OCR PdfConverter or reject the job with a clear message\n    raise","preventionTips":["Declare the [pdf] extra in the deployment manifest, not just core markitdown","Smoke-test one PDF conversion in CI to catch missing extras before release","Keep the chained __cause__ in logs — it names the exact failing import"],"tags":["missing-dependency","ocr","pdf","installation"],"backgroundTag":null,"analyzedSha":"fd239d5d2be43d9b68329730206b9312c7d5a388","analyzedAt":"2026-08-14T15:47:51.745Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}