{"record":{"id":"2db8f86f5981fa47","repo":"microsoft/markitdown","slug":"converter-recognized-the-input-as-a-potential-e-2db8f8","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/src/markitdown/converters/_pdf_converter.py","lineNumber":527,"sourceCode":"        extension = (stream_info.extension or \"\").lower()\n\n        if extension in ACCEPTED_FILE_EXTENSIONS:\n            return True\n\n        for prefix in ACCEPTED_MIME_TYPE_PREFIXES:\n            if mimetype.startswith(prefix):\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        assert isinstance(file_stream, io.IOBase)\n\n        # Read file stream into BytesIO for compatibility with pdfplumber\n        pdf_bytes = io.BytesIO(file_stream.read())\n\n        try:\n            # Single pass: check every page for form-style content.\n            # Pages with tables/forms get rich extraction; plain-text\n            # pages are collected separately. page.close() is called","sourceCodeStart":509,"sourceCodeEnd":545,"githubUrl":"https://github.com/microsoft/markitdown/blob/fd239d5d2be43d9b68329730206b9312c7d5a388/packages/markitdown/src/markitdown/converters/_pdf_converter.py#L509-L545","documentation":"MarkItDown's PdfConverter raises MissingDependencyException when convert() is called but pdfminer.six (and friends in the [pdf] extra) failed to import at module load. The converter accepted the stream as a PDF (extension .pdf or mimetype application/pdf, also matching the zip/pdf magic sniffing), then hits the dependency guard. Note this converter is also used as a fallback for unknown binary streams containing PDF signatures, so the error can appear even when you did not explicitly request PDF handling.","triggerScenarios":"Calling convert() on a .pdf file, a stream with mimetype application/pdf, or a sniffed PDF magic header (%PDF-) when markitdown was installed without the [pdf] extra; or when pdfminer_six is installed but its import raises (version conflicts with cryptography, broken installs).","commonSituations":"Minimal installs in Lambda/CI where package size matters and extras were skipped; processing mixed document folders where a PDF slips in; a pip resolver downgrade of pdfminer.six breaking its imports after another package pinned protobuf/cryptography.","solutions":["Install the pdf extra: pip install 'markitdown[pdf]'","Or install all extras: pip install 'markitdown[all]'","Confirm the import: python -c \"import pdfminer\"; fix/reinstall if it errors","For size-constrained deployments, install only the extras matching the formats you actually accept and reject other formats upstream"],"exampleFix":"# before\npip install markitdown\nMarkItDown().convert(\"report.pdf\")  # MissingDependencyException\n\n# after\npip install 'markitdown[pdf]'\nMarkItDown().convert(\"report.pdf\")","handlingStrategy":"try-catch","validationCode":"from markitdown.converters._pdf_converter import _dependency_exc_info\n\ndef can_convert_pdf() -> bool:\n    return _dependency_exc_info is None","typeGuard":null,"tryCatchPattern":"from markitdown import MarkItDown, MissingDependencyException\n\ntry:\n    result = MarkItDown().convert(\"doc.pdf\")\nexcept MissingDependencyException:\n    logger.error(\"install markitdown[pdf] to process PDFs\")\n    raise","preventionTips":["Install markitdown[pdf] (or [all]) in deployments that may see PDFs — remember sniffed PDFs reach this converter even without a .pdf extension","Startup-probe the pdf dependency before serving traffic","Pin pdfminer.six-compatible dependency versions to avoid import breakage"],"tags":["dependencies","installation","pdf","optional-extras"],"backgroundTag":null,"analyzedSha":"fd239d5d2be43d9b68329730206b9312c7d5a388","analyzedAt":"2026-08-14T15:47:51.745Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}