{"record":{"id":"16a96a8f5bf938da","repo":"microsoft/markitdown","slug":"converter-recognized-the-input-as-a-potential-e-16a96a","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/_xlsx_converter_with_ocr.py","lineNumber":64,"sourceCode":"\n        if extension == \".xlsx\":\n            return True\n\n        if mimetype.startswith(\n            \"application/vnd.openxmlformats-officedocument.spreadsheetml\"\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 _xlsx_dependency_exc_info is not None:\n            raise MissingDependencyException(\n                MISSING_DEPENDENCY_MESSAGE.format(\n                    converter=type(self).__name__,\n                    extension=\".xlsx\",\n                    feature=\"xlsx\",\n                )\n            ) from _xlsx_dependency_exc_info[1].with_traceback(\n                _xlsx_dependency_exc_info[2]\n            )  # type: ignore[union-attr]\n\n        # Get OCR service if available (from kwargs or instance)\n        ocr_service: Optional[LLMVisionOCRService] = (\n            kwargs.get(\"ocr_service\") or self.ocr_service\n        )\n\n        if ocr_service:\n            # Remove ocr_service from kwargs to avoid duplicate argument error\n            kwargs_without_ocr = {k: v for k, v in kwargs.items() if k != \"ocr_service\"}\n            return self._convert_with_ocr(","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/microsoft/markitdown/blob/fd239d5d2be43d9b68329730206b9312c7d5a388/packages/markitdown-ocr/src/markitdown_ocr/_xlsx_converter_with_ocr.py#L46-L82","documentation":"The OCR-enabled XlsxConverterWithOCR accepted an .xlsx stream, but the xlsx dependency import failed when the module was first loaded; the failure was captured in _xlsx_dependency_exc_info. convert() re-raises it as MissingDependencyException naming the [xlsx] extra. The underlying traceback is chained so the true failing import can be seen.","triggerScenarios":"Converting an Excel workbook via XlsxConverterWithOCR in an environment where openpyxl (the xlsx extra) is not installed.","commonSituations":"Slim Docker images that prune optional deps, mismatched virtual environments, or a fresh install of markitdown-ocr without the xlsx extra.","solutions":["pip install 'markitdown[xlsx]' or 'markitdown[all]' in the environment running the converter","Verify: python -c \"import openpyxl\"","Read the chained ImportError if the named extra is already installed — it may reveal a deeper import problem (missing system lib, version conflict)"],"exampleFix":"# before\npip install markitdown-ocr\nmd.convert(\"book.xlsx\")  # MissingDependencyException\n\n# after\npip install 'markitdown[xlsx]'\nmd.convert(\"book.xlsx\")","handlingStrategy":"try-catch","validationCode":"import importlib.util\n\nassert importlib.util.find_spec(\"openpyxl\") is not None","typeGuard":null,"tryCatchPattern":"from markitdown import MissingDependencyException\n\ntry:\n    result = md.convert(xlsx_stream, stream_info=StreamInfo(extension=\".xlsx\"))\nexcept MissingDependencyException as e:\n    log.error(\"xlsx extras missing: %s\", e)\n    raise","preventionTips":["Include the [xlsx] extra wherever markitdown-ocr is deployed","Audit slim images for pruned optional packages after multi-stage builds"],"tags":["missing-dependency","ocr","xlsx","installation"],"backgroundTag":null,"analyzedSha":"fd239d5d2be43d9b68329730206b9312c7d5a388","analyzedAt":"2026-08-14T15:47:51.745Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}