Skip to content

The agent that grows with you

fix(runtime): route dependency hints through pm

etherneted568bd947c1
diff --git a/agent/anthropic_adapter.py b/agent/anthropic_adapter.py
index b5bd7a5fbbe..05430e23424 100644
--- a/agent/anthropic_adapter.py
+++ b/agent/anthropic_adapter.py
@@ -56,7 +56,8 @@ def _require_sdk(purpose: str, verb: str = "Install it with"):
"""``_get_anthropic_sdk()`` or ImportError naming the feature that needs it."""
sdk = _get_anthropic_sdk()
if sdk is None:
- raise ImportError(f"The 'anthropic' package is required for {purpose}. {verb}: pip install 'anthropic>=0.39.0'")
+ raise ImportError(f"The 'anthropic' package is required for {purpose}. {verb}: "
+ "python -c \"from pm import sync_venv; sync_venv(['anthropic'], explicit=True)\"")
return sdk
@@ -427,7 +428,7 @@ def build_anthropic_bedrock_client(region: str):
from agent.bedrock_adapter import bedrock_guardrail_headers
sdk = _require_sdk("the Bedrock provider")
if not hasattr(sdk, "AnthropicBedrock"):
- raise ImportError("anthropic.AnthropicBedrock not available. Upgrade with: pip install 'anthropic>=0.39.0'")
+ raise ImportError("anthropic.AnthropicBedrock not available. Run: hermes pm repair")
return sdk.AnthropicBedrock(
aws_region=region, timeout=_client_timeout(None),
max_retries=0, # retry belongs to hermes's outer loop (honors Retry-After)
diff --git a/agent/azure_identity_adapter.py b/agent/azure_identity_adapter.py
index 1633ac4fbe8..19e6798fe3a 100644
--- a/agent/azure_identity_adapter.py
+++ b/agent/azure_identity_adapter.py
@@ -34,7 +34,7 @@ SCOPE_AI_AZURE_DEFAULT = "https://ai.azure.com/.default"
_AZURE_IDENTITY_FEATURE = "azure-identity"
_INSTALL_MSG = "The 'azure-identity' package is required for Azure AI Foundry Entra ID authentication. "
_LAZY_INSTALL_HINT = (
- "pip install azure-identity manually, or enable lazy installs (security.allow_lazy_installs: true in config.yaml)."
+ "Run: python -c \"from pm import sync_venv; sync_venv(['azure-identity'], explicit=True)\""
)
_AUTH_HEADERS = ("Authorization", "authorization", "Api-Key", "api-key", "X-Api-Key", "x-api-key")
@@ -57,7 +57,7 @@ def _require_azure_identity():
try:
from pm import InstallError, ensure_import
except ImportError as exc:
- raise ImportError(_INSTALL_MSG + "Install it with: pip install azure-identity") from exc
+ raise ImportError(_INSTALL_MSG + "Run: hermes pm repair") from exc
try:
ensure_import(_AZURE_IDENTITY_FEATURE)
except InstallError as exc:
@@ -118,7 +118,7 @@ def _install_failure(allow_install: bool) -> Optional[Dict[str, Any]]:
if has_azure_identity_installed():
return None
if not allow_install:
- return {"error": "azure-identity not installed", "hint": "pip install azure-identity (or rely on lazy install at first use)"}
+ return {"error": "azure-identity not installed", "hint": _LAZY_INSTALL_HINT}
try:
_require_azure_identity()
except ImportError as exc:
diff --git a/agent/bedrock_adapter.py b/agent/bedrock_adapter.py
index 365bff1f973..6a826d7e1bc 100644
--- a/agent/bedrock_adapter.py
+++ b/agent/bedrock_adapter.py
@@ -54,8 +54,7 @@ def _require_boto3():
except ImportError:
raise ImportError(
"The 'boto3' package is required for the AWS Bedrock provider. "
- "Install it with: pip install boto3\n"
- "Or install Hermes with Bedrock support: pip install -e '.[bedrock]'"
+ "Run: python -c \"from pm import sync_venv; sync_venv(['bedrock'], explicit=True)\""
)
try:
version = tuple(int(x) for x in boto3.__version__.split(".")[:3])
@@ -64,7 +63,7 @@ def _require_boto3():
if version < _MIN_BOTO3_VERSION:
raise RuntimeError(
f"boto3 {boto3.__version__} does not support converse_stream "
- f"(minimum 1.34.59 required). Upgrade with: pip install --upgrade boto3"
+ f"(minimum 1.34.59 required). Run: hermes pm repair"
)
return boto3
diff --git a/agent/image_routing.py b/agent/image_routing.py
index 6becbe2d8be..60f63a45f01 100644
--- a/agent/image_routing.py
+++ b/agent/image_routing.py
@@ -432,8 +432,8 @@ def _transcode_to_png(raw: bytes) -> Optional[bytes]:
except ImportError:
logger.info(
"image_routing: Pillow not installed; cannot transcode "
- "non-standard image format to PNG. Install with `pip install Pillow` "
- "(and `pillow-heif` / `pillow-avif-plugin` for those formats)."
+ "non-standard image format to PNG. Run `hermes pm repair` to restore Pillow, "
+ "or convert the image to PNG before sending it."
)
return None
with suppress(Exception):
diff --git a/agent/monitoring/otlp_exporter.py b/agent/monitoring/otlp_exporter.py
index 692da72e4a7..7ac7a6a82c1 100644
--- a/agent/monitoring/otlp_exporter.py
+++ b/agent/monitoring/otlp_exporter.py
@@ -66,7 +66,7 @@ def _require_sdk(names: Iterable[str] = _SPAN_SDK, *, auto_install: bool = True)
except Exception as e: # ImportError or partial install
raise OTLPUnavailable(
"OTLP export requires the optional dependency. Install with:\n"
- " pip install 'hermes-agent[otlp]'\n"
+ " python -c \"from pm import sync_venv; sync_venv(['otlp'], explicit=True)\"\n"
f"(import error: {e})"
)
diff --git a/agent/trace_upload.py b/agent/trace_upload.py
index 361225bce5b..241db54fcbd 100644
--- a/agent/trace_upload.py
+++ b/agent/trace_upload.py
@@ -195,7 +195,8 @@ def _do_upload(
try:
from huggingface_hub import HfApi
except ImportError:
- return "Hugging Face upload needs the `huggingface_hub` package (`pip install huggingface_hub`)."
+ return ("Hugging Face upload needs the `huggingface_hub` package. Run: "
+ "python -c \"from pm import sync_venv; sync_venv(['trace-upload'], explicit=True)\"")
api = HfApi(token=token)
try:
who = api.whoami()
diff --git a/agent/video_gen_provider.py b/agent/video_gen_provider.py
index 31ec67e105d..eaa47466da0 100644
--- a/agent/video_gen_provider.py
+++ b/agent/video_gen_provider.py
@@ -182,7 +182,7 @@ class OpenAICompatibleVideoGenProvider(VideoGenProvider):
import openai
except ImportError:
return error_response(
- error="openai Python package not installed (pip install openai)",
+ error="openai Python package not installed. Run: hermes pm repair",
error_type="missing_dependency", provider=self.name,
)
diff --git a/gateway/platforms/base.py b/gateway/platforms/base.py
index a3453e89bec..ef66e8240c8 100644
--- a/gateway/platforms/base.py
+++ b/gateway/platforms/base.py
@@ -355,7 +355,7 @@ def _aiohttp_socks_connector(proxy_url: str):
except ImportError:
if proxy_url.lower().startswith("socks"):
logger.warning("aiohttp_socks not installed — SOCKS proxy %s ignored. "
- "Run: pip install aiohttp-socks", proxy_url)
+ "Use an HTTP proxy instead.", proxy_url)
return None
diff --git a/gateway/platforms/qqbot/adapter.py b/gateway/platforms/qqbot/adapter.py
index 7a152d3ef3e..9d814eea4ab 100644
--- a/gateway/platforms/qqbot/adapter.py
+++ b/gateway/platforms/qqbot/adapter.py
@@ -190,8 +190,9 @@ class QQAdapter(BasePlatformAdapter):
"""Authenticate, obtain gateway URL, and open the WebSocket. ``is_reconnect``
is accepted for interface conformance only (QQBot has no server-side update queue)."""
for ok, code, what, hint in (
- (AIOHTTP_AVAILABLE, "qq_missing_dependency", "aiohttp not installed", ". Run: pip install aiohttp"),
- (HTTPX_AVAILABLE, "qq_missing_dependency", "httpx not installed", ". Run: pip install httpx"),
+ (AIOHTTP_AVAILABLE, "qq_missing_dependency", "aiohttp not installed",
+ ". Run: python -c \"from pm import sync_venv; sync_venv(['messaging'], explicit=True)\""),
+ (HTTPX_AVAILABLE, "qq_missing_dependency", "httpx not installed", ". Run: hermes pm repair"),
(self._app_id and self._client_secret, "qq_missing_credentials",
"QQ_APP_ID and QQ_CLIENT_SECRET are required", "")):
if not ok:
@@ -1132,7 +1133,8 @@ class QQAdapter(BasePlatformAdapter):
try:
import pilk
except ImportError:
- logger.warning("[%s] pilk not installed — cannot decode SILK audio. Run: pip install pilk", self._log_tag)
+ logger.warning("[%s] pilk not installed — cannot decode SILK audio. Run: "
+ "python -c \"from pm import sync_venv; sync_venv(['silk'], explicit=True)\"", self._log_tag)
return None
silk_path = src_path.rsplit(".", 1)[0] + ".silk"
diff --git a/gateway/platforms/qqbot/onboard.py b/gateway/platforms/qqbot/onboard.py
index 44a0b917b5c..0a3b848accf 100644
--- a/gateway/platforms/qqbot/onboard.py
+++ b/gateway/platforms/qqbot/onboard.py
@@ -97,7 +97,8 @@ def qr_register(timeout_seconds: int = 600) -> Optional[dict]:
print(f" Scan the QR code above, or open this URL directly:\n {url}")
else:
print(f" Open this URL in QQ on your phone:\n {url}")
- print(" Tip: pip install qrcode to display a scannable QR code here")
+ print(" For a scannable QR code, run: "
+ "python -c \"from pm import sync_venv; sync_venv(['messaging'], explicit=True)\"")
print()
while time.monotonic() < deadline:
try:
diff --git a/gateway/platforms/yuanbao.py b/gateway/platforms/yuanbao.py
index d2a8d045368..1524523f711 100644
--- a/gateway/platforms/yuanbao.py
+++ b/gateway/platforms/yuanbao.py
@@ -1806,7 +1806,7 @@ class ConnectionManager:
if not WEBSOCKETS_AVAILABLE:
msg = "Yuanbao startup failed: 'websockets' package not installed"
adapter._set_fatal_error("yuanbao_missing_dependency", msg, retryable=True)
- logger.warning("[%s] %s. Run: pip install websockets", adapter.name, msg)
+ logger.warning("[%s] %s. Run: hermes pm repair", adapter.name, msg)
return False
if not adapter._app_key or not adapter._app_secret:
msg = "Yuanbao startup failed: YUANBAO_APP_ID and YUANBAO_APP_SECRET are required"
diff --git a/gateway/run.py b/gateway/run.py
index 7e70a8dbf99..f695ded1cf6 100644
--- a/gateway/run.py
+++ b/gateway/run.py
@@ -3246,7 +3246,7 @@ _BUILTIN_ADAPTERS: dict[Platform, tuple[str, str, str, str]] = {
Platform.QQBOT: ("qqbot", "QQAdapter", "check_qq_requirements",
"QQBot: aiohttp/httpx missing or QQ_APP_ID/QQ_CLIENT_SECRET not configured"),
Platform.YUANBAO: ("yuanbao", "YuanbaoAdapter", "WEBSOCKETS_AVAILABLE",
- "Yuanbao: websockets not installed. Run: pip install websockets")}
+ "Yuanbao: websockets not installed. Run: hermes pm repair")}
def _instantiate_builtin_adapter(platform: Platform, config: Any) -> Optional[BasePlatformAdapter]:
diff --git a/gateway/run_turn.py b/gateway/run_turn.py
index 195e42c642d..1aacbdda574 100644
--- a/gateway/run_turn.py
+++ b/gateway/run_turn.py
@@ -2466,7 +2466,8 @@ class GatewayTurnMixin:
try:
from aiohttp import ClientSession as _AioClientSession, ClientTimeout
except ImportError:
- return self._proxy_error_result("⚠️ Proxy mode requires aiohttp. Install with: pip install aiohttp")
+ return self._proxy_error_result("⚠️ Proxy mode requires aiohttp. Run: "
+ "python -c \"from pm import sync_venv; sync_venv(['messaging'], explicit=True)\"")
proxy_url = self._get_proxy_url()
if not proxy_url:
diff --git a/gateway/run_voice.py b/gateway/run_voice.py
index e4f36ec0b85..e4dc3bd4fe2 100644
--- a/gateway/run_voice.py
+++ b/gateway/run_voice.py
@@ -164,7 +164,7 @@ class GatewayVoiceMixin:
if not any(tok in str(e).lower() for tok in ("pynacl", "nacl", "davey")):
return f"Failed to join voice channel: {e}"
return ("Voice dependencies are missing (PyNaCl / davey). "
- f"Install with: `{sys.executable} -m pip install PyNaCl`")
+ "Run: `python -c \"from pm import sync_venv; sync_venv(['discord'], explicit=True)\"`")
if not success:
adapter._voice_input_callback = None
return "Failed to join voice channel. Check bot permissions (Connect + Speak)."
diff --git a/tests/agent/test_azure_identity_adapter.py b/tests/agent/test_azure_identity_adapter.py
index 937731b1079..69e6ff027cf 100644
--- a/tests/agent/test_azure_identity_adapter.py
+++ b/tests/agent/test_azure_identity_adapter.py
@@ -394,7 +394,7 @@ class TestHasAzureIdentityCredentials:
"""With allow_install=True (default), the probe must trigger the
lazy-install path before bailing — otherwise the wizard's
``preflight`` would silently fail for fresh installs that haven't
- run ``pip install azure-identity`` yet."""
+ enabled the Azure identity extra yet."""
from agent import azure_identity_adapter as _adapter
installed = {"called": False}
@@ -481,7 +481,7 @@ class TestDescribeActiveCredential:
)
assert info["ok"] is False
assert "lazy installs disabled" in info["error"]
- assert "lazy" in info["hint"].lower()
+ assert "sync_venv(['azure-identity'], explicit=True)" in info["hint"]
def test_reports_env_sources_for_managed_identity(self, fake_azure_identity, monkeypatch):
from agent.azure_identity_adapter import describe_active_credential
diff --git a/tests/tools/test_wake_word.py b/tests/tools/test_wake_word.py
index 56c9b062a97..039004921b3 100644
--- a/tests/tools/test_wake_word.py
+++ b/tests/tools/test_wake_word.py
@@ -373,7 +373,7 @@ def test_requirements_lazy_disabled_returns_remedy_not_nameerror(monkeypatch):
r = ww.check_wake_word_requirements({"provider": "openwakeword"})
assert r["available"] is False
assert r["deps_available"] is False
- assert "uv sync --frozen --extra wake-openwakeword" in r["hint"]
+ assert "sync_venv(['wake-openwakeword'], explicit=True)" in r["hint"]
def test_requirements_deps_present_but_no_audio_hint(monkeypatch):
diff --git a/tools/browser_cdp_tool.py b/tools/browser_cdp_tool.py
index 982d1fdb328..74621bdee07 100644
--- a/tools/browser_cdp_tool.py
+++ b/tools/browser_cdp_tool.py
@@ -275,7 +275,7 @@ def browser_cdp(method: str, params: Optional[Dict[str, Any]] = None, target_id:
return tool_error("'method' is required (e.g. 'Target.getTargets')", cdp_docs=CDP_DOCS_URL)
if not _WS_AVAILABLE:
return tool_error("The 'websockets' Python package is required but not installed. "
- "Install it with: pip install websockets")
+ "Run: hermes pm repair")
endpoint = _resolve_cdp_endpoint()
if not endpoint:
return tool_error("No CDP endpoint is available. Run '/browser connect' to attach to a running Chrome, "
diff --git a/tools/computer_use/cua_backend.py b/tools/computer_use/cua_backend.py
index 204f3b2ac03..4d2d00b4ec7 100644
--- a/tools/computer_use/cua_backend.py
+++ b/tools/computer_use/cua_backend.py
@@ -278,8 +278,8 @@ class CuaDriverBackend(_CaptureMixin, _InputMixin, ComputerUseBackend):
# backend uses — so users never hit an opaque `No module named 'mcp'`
# at invoke time. Auto-install is gated by `security.allow_lazy_installs`
# (default on); when it's disabled or fails, ensure_import() raises
- # InstallError carrying an actionable `uv pip install mcp==…`
- # hint, which surfaces via the backend-unavailable path in tool.py.
+ # InstallError explaining why PM could not enable the SDK,
+ # which surfaces via the backend-unavailable path in tool.py.
from pm import ensure_import
ensure_import("computer-use")
# A just-installed package may not be importable until the import
diff --git a/tools/file_tools.py b/tools/file_tools.py
index 75e8663c50a..83f5ec2daee 100644
--- a/tools/file_tools.py
+++ b/tools/file_tools.py
@@ -1022,7 +1022,7 @@ READ_FILE_SCHEMA = {
# Document formats are stated unconditionally: firecrawl-anydoc is a
# core dependency (bundled), so its absence is a broken install, not a
# configuration — the teaching error in read_extract handles that rare
- # case with the pip-install fix. The ONE dynamic word: "PDF (text
+ # case with the PM repair hint. The ONE dynamic word: "PDF (text
# layer)" upgrades to "PDF (scanned or text)" when hosted OCR has a
# route we trust (_read_file_schema_overrides). Scanned-page coverage
# teaching lives in the response-time NEEDS-OCR warning
diff --git a/tools/mcp_oauth.py b/tools/mcp_oauth.py
index 226ca9632a8..44279f74b72 100644
--- a/tools/mcp_oauth.py
+++ b/tools/mcp_oauth.py
@@ -978,7 +978,8 @@ def build_oauth_auth(server_name: str, server_url: str, oauth_config: dict | Non
uses :func:`tools.mcp_oauth_manager.get_manager` so state is shared across config-time, runtime and reconnect paths."""
global HermesOAuthClientProvider
if not _OAUTH_AVAILABLE or _sdk_class("OAuthClientProvider") is None:
- logger.warning("MCP OAuth requested for '%s' but SDK auth types are not available. Install with: pip install 'mcp>=1.26.0'", server_name)
+ logger.warning("MCP OAuth requested for '%s' but SDK auth types are not available. Run: "
+ "python -c \"from pm import sync_venv; sync_venv(['mcp'], explicit=True)\"", server_name)
return None
from tools.mcp_oauth_provider import build_provider_kwargs, prepare_oauth_config
diff --git a/tools/neutts_synth.py b/tools/neutts_synth.py
index e70603dc117..b12b9f5482c 100644
--- a/tools/neutts_synth.py
+++ b/tools/neutts_synth.py
@@ -4,7 +4,7 @@
Called by tts_tool via subprocess so the ~500MB TTS model lives in a process that exits
after synthesis. Usage:
python -m tools.neutts_synth --text "Hello" --out out.wav --ref-audio jo.wav --ref-text jo.txt
-Requires ``pip install -U neutts[all]`` and espeak-ng (apt/brew).
+Run ``hermes setup tts`` and choose NeuTTS; espeak-ng is also required (apt/brew).
"""
import argparse
@@ -50,7 +50,7 @@ def main():
try:
from neutts import NeuTTS
except ImportError:
- print("Error: neutts not installed. Run: python -m pip install -U neutts[all]", file=sys.stderr)
+ print("Error: neutts not installed. Run hermes setup tts and choose NeuTTS.", file=sys.stderr)
sys.exit(1)
# llama_cpp (backbone) offloads to GPU only for the literal string "gpu";
diff --git a/tools/read_extract.py b/tools/read_extract.py
index 404ce12c6d0..c97f9bb2608 100644
--- a/tools/read_extract.py
+++ b/tools/read_extract.py
@@ -141,8 +141,8 @@ def _anydoc_missing_error(path: str) -> str:
return (
f"Cannot convert {path!r}: this format needs the optional anydoc "
"converter, which is not installed (install blocked or first "
- "attempt failed; retried every 5 minutes). Fix: `pip install "
- "firecrawl-anydoc` in Hermes's environment, or convert the file "
+ "attempt failed; retried every 5 minutes). Run `hermes pm repair` "
+ "to restore firecrawl-anydoc, or convert the file "
"yourself via terminal (e.g. libreoffice --headless --convert-to "
"txt).")
diff --git a/tools/send_message_senders.py b/tools/send_message_senders.py
index b8896c82cba..4677c0fa61a 100644
--- a/tools/send_message_senders.py
+++ b/tools/send_message_senders.py
@@ -304,7 +304,8 @@ async def _send_telegram(
return {"error": _NO_DELIVERABLE, **({"warnings": warnings} if warnings else {})}
return _success("telegram", chat_id, warnings, message_id=str(last_msg.message_id))
except ImportError:
- return {"error": "python-telegram-bot not installed. Run: pip install python-telegram-bot"}
+ return {"error": "python-telegram-bot not installed. Run: "
+ "python -c \"from pm import sync_venv; sync_venv(['telegram'], explicit=True)\""}
except Exception as e:
return _error(f"Telegram send failed: {e}")
@@ -366,7 +367,8 @@ async def _resolve_slack_user_target(token, chat_id):
try:
import aiohttp
except ImportError:
- return None, {"error": "aiohttp not installed. Run: pip install aiohttp"}
+ return None, {"error": "aiohttp not installed. Run: "
+ "python -c \"from pm import sync_venv; sync_venv(['messaging'], explicit=True)\""}
try:
from gateway.platforms.base import resolve_proxy_url, proxy_kwargs_for_aiohttp
_sess_kw, _req_kw = proxy_kwargs_for_aiohttp(resolve_proxy_url())
@@ -538,7 +540,8 @@ async def _send_matrix_via_adapter(pconfig, chat_id, message, media_files=None,
try:
from plugins.platforms.matrix.adapter import MatrixAdapter
except ImportError:
- return {"error": "Matrix dependencies not installed. Run: pip install 'mautrix[encryption]'"}
+ return {"error": "Matrix dependencies not installed. Run: "
+ "python -c \"from pm import sync_venv; sync_venv(['matrix'], explicit=True)\""}
adapter = MatrixAdapter(pconfig)
try:
if not await adapter.connect():
@@ -619,7 +622,7 @@ async def _send_qqbot(pconfig, chat_id, message):
try:
import httpx
except ImportError:
- return _error("QQBot direct send requires httpx. Run: pip install httpx")
+ return _error("QQBot direct send requires httpx. Run: hermes pm repair")
# Profile-scoped lookup so a multiplex profile never borrows another's QQ credentials.
from gateway.config import _getenv
diff --git a/tools/terminal_tool_backends.py b/tools/terminal_tool_backends.py
index 335bb1c3048..fbe7af774e2 100644
--- a/tools/terminal_tool_backends.py
+++ b/tools/terminal_tool_backends.py
@@ -237,7 +237,7 @@ def _check_vercel(config: Dict[str, Any]) -> bool:
"Use the default shared setting (51200 MB).", disk)
return False
if importlib.util.find_spec("vercel") is None:
- logger.error("vercel is required for the Vercel Sandbox terminal backend: pip install vercel")
+ logger.error("vercel is required for the Vercel Sandbox terminal backend. Run hermes setup terminal and select Vercel Sandbox.")
return False
from agent.secret_scope import get_secret
if get_secret("VERCEL_OIDC_TOKEN"):
@@ -284,7 +284,7 @@ _BACKEND_SPECS: Dict[str, Dict[str, Any]] = {
"singularity": {"binary": (lambda: shutil.which("apptainer") or shutil.which("singularity"), "--version", None)},
"ssh": {"pre": _ssh_pre},
"modal": {"pre": _modal_pre,
- "module": ("modal", "modal is required for direct modal terminal backend: pip install modal")},
+ "module": ("modal", "modal is required for direct modal terminal backend. Run hermes setup terminal and select Modal.")},
"vercel_sandbox": {"pre": _check_vercel},
"daytona": {"post": _daytona_post},
}
diff --git a/tools/transcription_local.py b/tools/transcription_local.py
index 8f12cc7a8d2..3ac2a67e88c 100644
--- a/tools/transcription_local.py
+++ b/tools/transcription_local.py
@@ -69,10 +69,8 @@ def _try_lazy_install_stt() -> bool:
logger.warning(
"Lazy install of faster-whisper failed: %s. "
"This is often a permission issue: the Hermes process user cannot "
- "write to the virtual environment. Try running manually as the "
- "venv owner: `stat -c '%%u' '$(dirname $(dirname $(which python3)))'` "
- "then `su - <owner> -c 'VIRTUAL_ENV=/opt/hermes/.venv "
- "uv pip install faster-whisper==1.2.1'`",
+ "write to the dependency environment. Run `hermes tools` as the "
+ "Hermes installation owner and select Local Whisper under Speech-to-Text.",
exc)
return False
diff --git a/tools/tts_tool.py b/tools/tts_tool.py
index a1fe3f2e9f6..36f8cae0e96 100644
--- a/tools/tts_tool.py
+++ b/tools/tts_tool.py
@@ -173,7 +173,8 @@ _FFMPEG_OPUS_PROVIDERS = frozenset({"edge", "neutts", "minimax", "xai", "kittent
# Predicates/generator names resolve module globals at call time so test monkeypatches apply.
_BUILTIN_DISPATCH: Dict[str, tuple] = {
"elevenlabs": (lambda: _importable(_import_elevenlabs), "ElevenLabs", "_generate_elevenlabs",
- "ElevenLabs provider selected but 'elevenlabs' package not installed. Run: pip install elevenlabs"),
+ "ElevenLabs provider selected but 'elevenlabs' package not installed. Run: "
+ "python -c \"from pm import sync_venv; sync_venv(['tts-premium'], explicit=True)\""),
"openai": (lambda: _importable(_import_openai_client), "OpenAI TTS", "_generate_openai_tts",
"OpenAI provider selected but 'openai' package not installed."),
"deepinfra": (lambda: _importable(_import_openai_client), "DeepInfra TTS", "_generate_deepinfra_tts",
@@ -186,15 +187,13 @@ _BUILTIN_DISPATCH: Dict[str, tuple] = {
"gemini": (None, "Google Gemini TTS", "_generate_gemini_tts", None),
"neutts": (lambda: _check_neutts_available(), "NeuTTS (local)", "_generate_neutts",
"NeuTTS provider selected but neutts is not installed. "
- "Run hermes setup and choose NeuTTS, or install espeak-ng and run python -m pip install -U neutts[all]."),
+ "Run hermes setup tts and choose NeuTTS; espeak-ng is also required."),
"kittentts": (lambda: _importable(_import_kittentts), "KittenTTS (local, ~25MB)", "_generate_kittentts",
"KittenTTS provider selected but 'kittentts' package not installed. "
- "Run 'hermes setup tts' and choose KittenTTS, or install manually: "
- "pip install https://github.com/KittenML/KittenTTS/releases/download/0.8.1/kittentts-0.8.1-py3-none-any.whl"),
+ "Run 'hermes setup tts' and choose KittenTTS."),
"piper": (lambda: _importable(_import_piper), "Piper (local)", "_generate_piper_tts",
"Piper provider selected but 'piper-tts' package not installed. "
- "Run 'hermes tools' and select Piper under TTS, or install manually: "
- "pip install piper-tts")}
+ "Run 'hermes tools' and select Piper under TTS.")}
def _error_json(message: str) -> str:
@@ -225,8 +224,9 @@ def _select_builtin_engine(provider: str) -> tuple:
logger.info("Edge TTS not available, falling back to NeuTTS (local)...")
return "neutts", None
return provider, _error_json(
- "No TTS provider available. Install edge-tts (pip install edge-tts) "
- "or set up NeuTTS for local synthesis.")
+ "No TTS provider available. Enable Edge TTS with: "
+ "python -c \"from pm import sync_venv; sync_venv(['edge-tts'], explicit=True)\" "
+ "or run 'hermes setup tts' and choose NeuTTS for local synthesis.")
def _synthesize_builtin(engine: str, text: str, file_str: str, tts_config: Dict[str, Any], instructions: Optional[str]) -> None:
diff --git a/tools/vision_tools.py b/tools/vision_tools.py
index e6e7533a882..da90389eea0 100644
--- a/tools/vision_tools.py
+++ b/tools/vision_tools.py
@@ -569,8 +569,8 @@ async def _prepare_image(
def _too_large_message(image_data_url: str) -> str:
return (
f"Image too large for vision API: base64 payload is {len(image_data_url) / (1024 * 1024):.1f} MB "
- f"(limit {_MAX_BASE64_BYTES / (1024 * 1024):.0f} MB) even after resizing. Install Pillow "
- f"(`pip install Pillow`) for better auto-resize, or compress the image manually.")
+ f"(limit {_MAX_BASE64_BYTES / (1024 * 1024):.0f} MB) even after resizing. Run `hermes pm repair` "
+ f"to restore Pillow for auto-resize, or compress the image manually.")
async def _resize_prepared(prepared: _PreparedImage, scale_info: dict, **kwargs) -> str:
diff --git a/tools/vision_tools_image_prep.py b/tools/vision_tools_image_prep.py
index 908c1ef1851..19722c776ae 100644
--- a/tools/vision_tools_image_prep.py
+++ b/tools/vision_tools_image_prep.py
@@ -135,8 +135,7 @@ def _normalize_to_supported_image(
"This is an SVG, which vision models cannot read directly, and no "
"SVG rasterizer is installed (tried cairosvg, svglib, rsvg-convert, "
"inkscape). Convert the SVG to PNG first — e.g. open it in a browser "
- "and screenshot it, or install a rasterizer "
- "(`pip install cairosvg`) — then re-run vision_analyze on the PNG.")
+ "and screenshot it — then re-run vision_analyze on the PNG.")
try:
from PIL import Image as _PILImage
with _PILImage.open(image_path) as _img:
@@ -219,7 +218,7 @@ def _crop_image_region(
from PIL import Image
except ImportError:
return None, None, (
- "region cropping requires Pillow (`pip install Pillow`); "
+ "region cropping requires Pillow (run `hermes pm repair`); "
"retry without the region parameter.")
if not (isinstance(region, (list, tuple)) and len(region) == 4
and all(isinstance(v, (int, float)) and not isinstance(v, bool) for v in region)):
diff --git a/tools/voice_mode.py b/tools/voice_mode.py
index ead96580674..704511b19d3 100644
--- a/tools/voice_mode.py
+++ b/tools/voice_mode.py
@@ -5,8 +5,8 @@ STT dispatch via tools.transcription_tools, and TTS playback via
sounddevice or system audio players.
Dependencies (optional):
- pip install sounddevice numpy
- or: uv sync --extra voice
+ python -c "from pm import sync_venv; sync_venv(['audio-io'], explicit=True)"
+ Configure speech-to-text with ``hermes tools``.
"""
import logging
@@ -118,20 +118,7 @@ def _default_input_samplerate(sd) -> int:
def _voice_capture_install_hint() -> str:
- # If we're running inside a venv (e.g. the bundled Hermes venv at
- # ~/.hermes/profiles/<name>/hermes-agent/venv/), `pip install` on the
- # user's PATH won't reach the right site-packages — the bare hint sends
- # them off to whichever Python their shell resolves first, which on macOS
- # is often a system Python under Rosetta with a totally separate wheel
- # index. Point them at the actual interpreter pip is sitting next to.
- try:
- if sys.prefix != getattr(sys, "base_prefix", sys.prefix):
- pip_in_venv = Path(sys.prefix) / "bin" / "pip"
- if pip_in_venv.exists():
- return f"{pip_in_venv} install sounddevice numpy"
- except Exception:
- pass
- return "pip install sounddevice numpy"
+ return "python -c \"from pm import sync_venv; sync_venv(['audio-io'], explicit=True)\""
def _pulse_socket_reachable() -> bool:
@@ -815,7 +802,7 @@ class AudioRecorder:
except ImportError as e:
raise RuntimeError(
"Voice mode requires sounddevice and numpy.\n"
- f"Install with: {sys.executable} -m pip install sounddevice numpy"
+ f"Install with: {_voice_capture_install_hint()}"
) from e
with self._lock:
@@ -1888,9 +1875,8 @@ def check_voice_requirements() -> Dict[str, Any]:
details_parts.append(f"STT provider: OK (plugin: {stt_provider})")
else:
details_parts.append(
- "STT provider: MISSING (uv pip install faster-whisper — "
- "`pip install faster-whisper` also works if pip is on PATH, "
- "or set GROQ_API_KEY / VOICE_TOOLS_OPENAI_KEY)"
+ "STT provider: MISSING (run `hermes tools` and configure "
+ "Speech-to-Text: Local Whisper or a cloud provider)"
)
for warning in env_check["warnings"]:
diff --git a/tools/wake_word.py b/tools/wake_word.py
index cf1bcdc2853..04c9bff3b33 100644
--- a/tools/wake_word.py
+++ b/tools/wake_word.py
@@ -389,7 +389,7 @@ def check_wake_word_requirements(cfg: Optional[Dict[str, Any]] = None, *,
key_ok = False
hint = "Set PORCUPINE_ACCESS_KEY (free key at https://console.picovoice.ai)."
elif not deps_ok and not lazy_ok:
- hint = f"uv sync --frozen --extra {feature}"
+ hint = f"python -c \"from pm import sync_venv; sync_venv(['{feature}'], explicit=True)\""
elif deps_ok and not audio_ok and resolve_capture_mode(cfg) == "local":
hint = "Microphone capture needs sounddevice + numpy and a working audio device."
elif not stt_ok or not tts_ok: