{"record":{"id":"4ab3fb953237fa8c","repo":"zylon-ai/private-gpt","slug":"email-reader-dependencies-are-not-installed","errorCode":null,"errorMessage":"Email reader dependencies are not installed.","messagePattern":"Email reader dependencies are not installed\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/readers/factories/text.py","lineNumber":26,"sourceCode":"        from private_gpt.components.readers.text.delimiter_reader import (\n            DelimiterTextReader,\n        )\n    except ImportError as e:\n        raise ImportError(\n            format_missing_dependency_message(\n                \"Delimited text reader\",\n            )\n        ) from e\n    return DelimiterTextReader()\n\n\ndef _email_reader() -> IngestionReader:\n    try:\n        from private_gpt.components.readers.text.email_reader import (\n            EmailTextReader,\n        )\n    except ImportError as e:\n        raise ImportError(\n            format_missing_dependency_message(\n                \"Email reader\",\n            )\n        ) from e\n    return EmailTextReader()\n\n\ndef _html_reader() -> IngestionReader:\n    try:\n        from private_gpt.components.readers.text.html_reader import (\n            HtmlReader,\n        )\n    except ImportError as e:\n        raise ImportError(\n            format_missing_dependency_message(\n                \"HTML reader\",\n                extras=\"ingest-markup\",\n            )","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/readers/factories/text.py#L8-L44","documentation":"Raised as ImportError by _email_reader() in factories/text.py when the lazy import of EmailTextReader fails. As with the delimiter reader, no extras argument is passed to format_missing_dependency_message, so the message carries no install command — email parsing (e.g., the mail libs the reader uses) is considered core, and failure points to a broken or incomplete environment. The underlying ImportError is chained.","triggerScenarios":"Ingestion selecting the email sub-reader of the 'text' factory while private_gpt.components.readers.text.email_reader or one of its imports (e.g., a .eml/mail-parsing dependency) cannot be imported in the current interpreter.","commonSituations":"Broken venv after a partial install or dependency-conflict resolution; running under a different interpreter than the one dependencies were installed to; dependency removed by another tool (pipdeptree/pip uninstall) while pruning; upgrading private-gpt where a new email dependency was added but sync was skipped.","solutions":["Check e.__cause__ for the precise missing module name.","Re-run uv sync --inexact (with your usual extras) to restore the full dependency set.","Verify the interpreter matches the env (run via the project venv, e.g., .venv/bin/python or uv run).","If a mail-parsing package is individually missing, install it explicitly based on the cause."],"exampleFix":"# repair environment\n# uv sync --inexact --extra ingest\n# verify import works\n# uv run python -c \"from private_gpt.components.readers.text.email_reader import EmailTextReader\"","handlingStrategy":"validation","validationCode":"def email_reader_available() -> bool:\n    try:\n        from private_gpt.components.readers.text.email_reader import EmailTextReader  # noqa: F401\n        return True\n    except ImportError:\n        return False\n\nif not email_reader_available():\n    raise SystemExit(\"Environment incomplete: re-run uv sync --inexact (with your extras)\")","typeGuard":"def email_reader_available() -> bool:\n    try:\n        from private_gpt.components.readers.text.email_reader import EmailTextReader  # noqa: F401\n        return True\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    reader = _email_reader()\nexcept ImportError as e:\n    logger.error(\"missing module: %r\", e.__cause__ or e)\n    raise SystemExit(\"Repair environment with: uv sync\") from e","preventionTips":["No optional extra covers this reader — treat the failure as env corruption (partial sync, wrong interpreter).","Run the reader's import as part of a post-deploy smoke test before accepting traffic."],"tags":["dependencies","readers","email","text","installation"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}