{"record":{"id":"623020dd6fd18878","repo":"docling-project/docling","slug":"the-python-pptx-package-is-required-to-process-p","errorCode":null,"errorMessage":"The 'python-pptx' package is required to process PowerPoint files. Install it with `pip install 'docling-slim[format-pptx]'`.","messagePattern":"The 'python-pptx' package is required to process PowerPoint files\\. Install it with `pip install 'docling-slim\\[format-pptx\\]'`\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"docling/backend/mspowerpoint_backend.py","lineNumber":144,"sourceCode":"    \"\"\"\n\n    # XML relationship types\n    COMMENT_REL = (\n        \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments\"\n    )\n    COMMENT_AUTHORS_REL = (\n        \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/\"\n        \"commentAuthors\"\n    )\n\n    def __init__(\n        self,\n        in_doc: InputDocument,\n        path_or_stream: Union[BytesIO, Path],\n        options: Optional[MsPowerpointBackendOptions] = None,\n    ) -> None:\n        if not _PPTX_AVAILABLE:\n            raise ImportError(_INSTALL_HINT) from _PPTX_IMPORT_ERROR\n        if in_doc.format == InputFormat.PPT:\n            path_or_stream = convert_to_modern_format(path_or_stream, \"ppt\", \"pptx\")\n        if options is None:\n            options = MsPowerpointBackendOptions()\n        super().__init__(in_doc, path_or_stream, options)\n        self.path_or_stream: Union[BytesIO, Path] = path_or_stream\n        self.page_range = in_doc.limits.page_range\n\n        self.pptx_to_pdf_converter: Optional[Callable] = None\n        self.pptx_to_pdf_converter_init: bool = False\n        self._render_charts: bool = False\n\n        self.pptx_obj: Optional[presentation.Presentation] = None\n        self.valid: bool = False\n        try:\n            if isinstance(self.path_or_stream, BytesIO):\n                self.pptx_obj = Presentation(self.path_or_stream)\n            elif isinstance(self.path_or_stream, Path):","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/backend/mspowerpoint_backend.py#L126-L162","documentation":"ImportError raised by MsPowerpointDocumentBackend.__init__ when the optional dependency python-pptx is unavailable. Like the Excel backend, the PowerPoint support in docling-slim is opt-in via an extra, and the error message names the exact extra to install. The original import error is chained so the environment problem is traceable.","triggerScenarios":"Converting .pptx files while running docling-slim without the format-pptx extra; also .ppt legacy files, since they are pre-converted to .pptx (via soffice) and then still require python-pptx to parse.","commonSituations":"Slim Docker/CI installs, picking docling-slim to avoid heavy ML dependencies, or environments where python-pptx was pruned by a dependency resolver. Missing LibreOffice for .ppt input produces a different failure but this one hits first if python-pptx is absent.","solutions":["Install the extra: `pip install 'docling-slim[format-pptx]'` (equivalently `pip install python-pptx`).","Or install full `docling` which pulls format dependencies.","Pre-flight check: `python -c 'import pptx'` in deployment smoke tests.","For legacy .ppt also ensure LibreOffice (soffice) is installed."],"exampleFix":"# before\npip install docling-slim\nDocumentConverter().convert('deck.pptx')  # ImportError\n\n# after\npip install 'docling-slim[format-pptx]'\nDocumentConverter().convert('deck.pptx')","handlingStrategy":"validation","validationCode":"def pptx_support_available() -> bool:\n    try:\n        import pptx  # noqa: F401\n        return True\n    except ImportError:\n        return False\n\nif not pptx_support_available():\n    raise SystemExit(\"pip install 'docling-slim[format-pptx]'\")","typeGuard":null,"tryCatchPattern":"try:\n    result = converter.convert(pptx_path)\nexcept ImportError as e:\n    if 'python-pptx' in str(e):\n        raise SystemExit(\"Missing dependency: pip install 'docling-slim[format-pptx]'\") from e\n    raise","preventionTips":["Install the format-pptx extra wherever decks are converted.","Smoke-test `import pptx` in CI/deployment images.","For legacy .ppt, also ensure LibreOffice is present."],"tags":["powerpoint","dependency","import","docling-slim"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}