{"record":{"id":"11e3e55b35fd9ad9","repo":"zylon-ai/private-gpt","slug":"html-reader-dependencies-are-not-installed-instal","errorCode":null,"errorMessage":"HTML reader dependencies are not installed. Install with `uv sync --inexact --extra ingest-markup`.","messagePattern":"HTML reader dependencies are not installed\\. Install with `uv sync --inexact --extra ingest-markup`\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/readers/factories/text.py","lineNumber":40,"sourceCode":"        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            )\n        ) from e\n    return HtmlReader()\n\n\ndef _text_reader() -> IngestionReader:\n    try:\n        from private_gpt.components.readers.text.text_reader import (\n            TextReader,\n        )\n    except ImportError as e:\n        raise ImportError(\n            format_missing_dependency_message(\n                \"Text reader\",\n            )","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/readers/factories/text.py#L22-L58","documentation":"Raised as ImportError by _html_reader() in factories/text.py when the lazy import of HtmlReader fails because its HTML-parsing dependencies (e.g., beautifulsoup4/lxml-style libs) are not installed. These live in the 'ingest-markup' extra, and the message includes the precise uv sync command with --inexact to avoid disturbing other installed packages. The original ImportError is chained as __cause__.","triggerScenarios":"Ingesting HTML files through the 'text' reader without the ingest-markup extra installed — the lazy import inside _html_reader fails and is re-raised with install instructions. Can also fire when lxml/bs4 binary wheels are broken on exotic platforms even though the extra was installed.","commonSituations":"Default install without extras followed by ingesting .html files; slim Docker images; lxml failing to import due to a missing system libxml2 after an OS upgrade; partial venv state after switching Python versions without re-syncing.","solutions":["Run the command from the message: uv sync --inexact --extra ingest-markup.","If already installed, inspect e.__cause__ — for lxml issues install the system libraries (libxml2-dev/libxslt-dev) or re-install the wheel so it rebuilds.","Re-sync after any Python version change: uv sync (venv binaries like lxml are version-specific).","Alternatively route HTML through the 'docling' reader if you cannot add the extra locally."],"exampleFix":"# fix the environment\n# uv sync --inexact --extra ingest-markup\n# verify\n# uv run python -c \"from private_gpt.components.readers.text.html_reader import HtmlReader\"","handlingStrategy":"validation","validationCode":"def html_deps_available() -> bool:\n    try:\n        import bs4  # and/or lxml, per the reader's imports\n        return True\n    except ImportError:\n        return False\n\nif not html_deps_available():\n    raise SystemExit(\"Install first: uv sync --inexact --extra ingest-markup\")","typeGuard":"def html_deps_available() -> bool:\n    try:\n        import bs4  # noqa: F401\n        import lxml  # noqa: F401\n        return True\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    reader = _html_reader()\nexcept ImportError as e:\n    if \"ingest-markup\" in str(e):\n        raise SystemExit(\"Run: uv sync --inexact --extra ingest-markup\") from e\n    # installed but broken (e.g., lxml system libs): surface the cause\n    raise RuntimeError(f\"HTML deps present but unimportable: {e.__cause__!r}\") from e","preventionTips":["Install the ingest-markup extra in every environment that ingests HTML.","After OS upgrades, re-install lxml so its binary wheel matches system libxml2.","Re-sync the venv after changing Python versions — binary packages do not carry over."],"tags":["dependencies","readers","html","installation"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}