{"record":{"id":"93fe9db2f1bd2d2a","repo":"zylon-ai/private-gpt","slug":"markitdown-reader-dependencies-are-not-installed","errorCode":null,"errorMessage":"MarkItDown reader dependencies are not installed. Install with `uv sync --inexact --extra ingest-markitdown`.","messagePattern":"MarkItDown reader dependencies are not installed\\. Install with `uv sync --inexact --extra ingest-markitdown`\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/readers/factories/markitdown.py","lineNumber":15,"sourceCode":"from private_gpt.components.readers.base_reader import IngestionReader\nfrom private_gpt.components.readers.factories.base import ReaderFactory\nfrom private_gpt.utils.dependencies import format_missing_dependency_message\n\n\nclass MarkItDownReaderFactory(ReaderFactory):\n    def create_reader(self, extension: str | None = None) -> IngestionReader:\n        del extension\n\n        try:\n            from private_gpt.components.readers.markitdown.markitdown_reader import (\n                MarkItDownReader,\n            )\n        except ImportError as e:\n            raise ImportError(\n                format_missing_dependency_message(\n                    \"MarkItDown reader\",\n                    extras=\"ingest-markitdown\",\n                )\n            ) from e\n\n        return MarkItDownReader()\n","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/readers/factories/markitdown.py#L1-L23","documentation":"Raised as ImportError by MarkItDownReaderFactory.create_reader when the lazy import of private_gpt.components.readers.markitdown.markitdown_reader fails. Reader dependencies are optional extras in this project: the markitdown module imports the markitdown package, which is only installed with the 'ingest-markitdown' extra. The message includes the exact uv sync command; the original ImportError is chained so the truly missing module is visible via __cause__.","triggerScenarios":"Configuring ingestion to use the 'markitdown' reader (get_factory('markitdown').create_reader()) in an environment installed without the ingest-markitdown extra, or with a broken/partial install where the markitdown package itself is missing an optional sub-dependency it dynamically imports.","commonSituations":"Fresh clone installed as `uv sync` without extras, then selecting markitdown in settings; Docker images trimmed to default extras; a markitdown release that made a format handler an optional dependency, so the package imports but a transitive import fails.","solutions":["Run the exact command from the message: uv sync --inexact --extra ingest-markitdown (the --inexact flag keeps your other installed deps).","If it still fails after installing, inspect e.__cause__ to see which inner module is missing and add that dependency.","Alternatively switch the reader selection to 'docling' if you cannot add the extra to this environment.","For Docker deployments, add the extra to the image build (uv sync --inexact --extra ingest-markitdown in the Dockerfile)."],"exampleFix":"# before (fails at runtime)\nreader = registry.get_factory(\"markitdown\").create_reader()\n\n# fix the environment instead\n# uv sync --inexact --extra ingest-markitdown","handlingStrategy":"validation","validationCode":"def markitdown_available() -> bool:\n    try:\n        import markitdown  # noqa: F401\n        return True\n    except ImportError:\n        return False\n\nif not markitdown_available():\n    raise SystemExit(\"Install first: uv sync --inexact --extra ingest-markitdown\")","typeGuard":"def markitdown_available() -> bool:\n    try:\n        import markitdown  # noqa: F401\n        return True\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    reader = registry.get_factory(\"markitdown\").create_reader()\nexcept ImportError as e:\n    if \"ingest-markitdown\" in str(e):\n        raise SystemExit(\"Run: uv sync --inexact --extra ingest-markitdown\") from e\n    raise","preventionTips":["Install the extra in the same environment/interpreter that runs the app (uv run guarantees it).","Add import availability checks to deployment smoke tests for every reader you select in settings."],"tags":["dependencies","markitdown","readers","installation"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}