{"record":{"id":"4428b0c9b40b88a0","repo":"agentscope-ai/agentscope","slug":"please-install-python-pptx-to-use-the-powerpoint-p","errorCode":null,"errorMessage":"Please install python-pptx to use the PowerPoint parser. You can install it by `pip install python-pptx` (or `pip install agentscope[rag]`).","messagePattern":"Please install python-pptx to use the PowerPoint parser\\. You can install it by `pip install python-pptx` \\(or `pip install agentscope\\[rag\\]`\\)\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"src/agentscope/rag/_parser/_ppt.py","lineNumber":202,"sourceCode":"            `list[Section]`:\n                Sections in deck order.  Text sections carry\n                ``{\"slide\": <starting at 1>}``; image sections add\n                ``{\"media_type\": \"image/...\"}``.\n\n        Raises:\n            `FileNotFoundError`: If ``file`` is a ``str`` pointing to\n                a path that does not exist.\n            `ImportError`: If :mod:`python-pptx` is not installed.\n            `ValueError`: If the bytes cannot be parsed.\n        \"\"\"\n        if isinstance(file, str):\n            with open(file, \"rb\") as fp:\n                file = fp.read()\n\n        try:\n            from pptx import Presentation\n        except ImportError as e:\n            raise ImportError(\n                \"Please install python-pptx to use the PowerPoint \"\n                \"parser. You can install it by \"\n                \"`pip install python-pptx` (or \"\n                \"`pip install agentscope[rag]`).\",\n            ) from e\n\n        try:\n            prs = Presentation(io.BytesIO(file))\n        except Exception as e:  # pylint: disable=broad-except\n            raise ValueError(\n                f\"Failed to parse {filename!r} as PPTX: {e}\",\n            ) from e\n\n        sections: list[Section] = []\n        for slide_idx, slide in enumerate(prs.slides):\n            sections.extend(\n                self._parse_slide(slide, slide_idx, filename),\n            )","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/agentscope-ai/agentscope/blob/e90f1c7592896cc95f6e5ee506194f533378247d/src/agentscope/rag/_parser/_ppt.py#L184-L220","documentation":"The PowerPoint parser needs the optional python-pptx dependency. Its import inside parse() failed, raising ImportError with install instructions chained to the original error.","triggerScenarios":"Calling PPTParser.parse(...) without python-pptx installed (agentscope installed without [rag] extra).","commonSituations":"Base agentscope install; slim Docker/CI images missing optional deps.","solutions":["pip install python-pptx (or pip install 'agentscope[rag]')","Add python-pptx to project dependencies","Detect pptx availability before advertising PPT ingestion"],"exampleFix":"# before\nPPTParser().parse('slides.pptx')  # ImportError\n\n# after\n# pip install 'agentscope[rag]'\nPPTParser().parse('slides.pptx')","handlingStrategy":"validation","validationCode":"try:\n    import pptx  # noqa\n    pptx_ok = True\nexcept ImportError:\n    pptx_ok = False","typeGuard":null,"tryCatchPattern":"try:\n    parser.parse(f)\nexcept ImportError as e:\n    if 'python-pptx' not in str(e):\n        raise\n    logger.warning('PPT parsing disabled: install python-pptx')","preventionTips":["Install agentscope[rag] where PPT ingestion is needed","Feature-detect pptx at startup and disable the feature cleanly"],"tags":["agentscope","rag","pptx","missing-dependency","python-pptx"],"backgroundTag":"missing-optional-dependency","analyzedSha":"e90f1c7592896cc95f6e5ee506194f533378247d","analyzedAt":"2026-08-28T18:24:12.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}