microsoft/markitdown · error · MissingDependencyException

{converter} recognized the input as a potential {extension}

Error message

{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:

* pip install 'markitdown[{feature}]'
* pip install 'markitdown[all]'
* pip install 'markitdown[{feature}, ...]'
* etc.

What it means

The OCR-enabled PptxConverterWithOCR matched a .pptx stream, but the pptx extra's dependencies (python-pptx) could not be imported at module load. The stored exception is re-raised as MissingDependencyException in convert(), pointing at the [pptx] extra. Chaining via 'from' keeps the underlying ImportError visible for diagnosis.

Source

Thrown at packages/markitdown-ocr/src/markitdown_ocr/_pptx_converter_with_ocr.py:61

        if extension == ".pptx":
            return True

        if mimetype.startswith(
            "application/vnd.openxmlformats-officedocument.presentationml"
        ):
            return True

        return False

    def convert(
        self,
        file_stream: BinaryIO,
        stream_info: StreamInfo,
        **kwargs: Any,
    ) -> DocumentConverterResult:
        if _dependency_exc_info is not None:
            raise MissingDependencyException(
                MISSING_DEPENDENCY_MESSAGE.format(
                    converter=type(self).__name__,
                    extension=".pptx",
                    feature="pptx",
                )
            ) from _dependency_exc_info[1].with_traceback(
                _dependency_exc_info[2]
            )  # type: ignore[union-attr]

        # Get OCR service (from kwargs or instance)
        ocr_service: Optional[LLMVisionOCRService] = (
            kwargs.get("ocr_service") or self.ocr_service
        )
        llm_client = kwargs.get("llm_client")

        presentation = pptx.Presentation(file_stream)
        md_content = ""
        slide_num = 0

View on GitHub (pinned to fd239d5d2b)

Solutions

  1. pip install 'markitdown[pptx]' or 'markitdown[all]' in the runtime env
  2. Verify: python -c "import pptx"
  3. Inspect the chained ImportError to identify any secondary failure (e.g. a broken shared library)

Example fix

# before
pip install markitdown-ocr
md.convert("deck.pptx")  # MissingDependencyException

# after
pip install 'markitdown[pptx]'
md.convert("deck.pptx")
Defensive patterns

Strategy: try-catch

Validate before calling

import importlib.util

assert importlib.util.find_spec("pptx") is not None

Try / catch

from markitdown import MissingDependencyException

try:
    result = md.convert(pptx_stream, stream_info=StreamInfo(extension=".pptx"))
except MissingDependencyException as e:
    log.warning("pptx extras missing, skipping OCR: %s", e)
    raise

Prevention

When it happens

Trigger: Converting a PowerPoint file through PptxConverterWithOCR when python-pptx is missing from the environment.

Common situations: Optional extras omitted during deployment, a fresh venv created from a requirements.txt that listed markitdown-ocr but not its extras, or dependency resolution conflicts that uninstalled python-pptx.

Related errors


AI-assisted analysis of microsoft/markitdown@fd239d5d2b (2026-08-14). Data as JSON: /api/errors/aff7041c3c33b0cb. Report an issue: GitHub.