Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

Clarify parse server dependency install hint

jinzhenj5d0b5fe5eee0
diff --git a/mineru/parser/api_server.py b/mineru/parser/api_server.py
index d94c31e5..3d27866d 100644
--- a/mineru/parser/api_server.py
+++ b/mineru/parser/api_server.py
@@ -1994,6 +1994,13 @@ def _required_modules_for_tier(tier: Tier) -> list[str]:
return []
+def _tier_dependency_install_hint(tier: Tier) -> str:
+ return (
+ f"Install optional dependencies for this tier in the same Python environment as MinerU, "
+ f"for example: pip install 'mineru[{tier}]'."
+ )
+
+
def _preflight_tier_dependencies(tier: Tier) -> None:
missing_modules = []
for module_name in _required_modules_for_tier(tier):
@@ -2010,7 +2017,7 @@ def _preflight_tier_dependencies(tier: Tier) -> None:
missing = ", ".join(missing_modules)
raise ParseServerStartupError(
f"Parse server cannot start for tier '{tier}'; missing runtime dependencies: {missing}. "
- f"Install the required extra, for example: mineru[{tier}]."
+ f"{_tier_dependency_install_hint(tier)}"
)
diff --git a/tests/unittest/test_parser_api_contract.py b/tests/unittest/test_parser_api_contract.py
index e5f89998..78c8e4fa 100644
--- a/tests/unittest/test_parser_api_contract.py
+++ b/tests/unittest/test_parser_api_contract.py
@@ -775,7 +775,8 @@ def test_api_server_cli_reports_dependency_preflight_without_traceback(monkeypat
assert result.exit_code == 1
assert result.output == (
"Error: Parse server cannot start for tier 'pro'; missing runtime dependencies: mlx. "
- "Install the required extra, for example: mineru[pro].\n"
+ "Install optional dependencies for this tier in the same Python environment as MinerU, "
+ "for example: pip install 'mineru[pro]'.\n"
)
assert "Traceback" not in result.output