Skip to content

hermes update fails when Hermes is installed via uv tool install #29700

@lexbocharov

Description

@lexbocharov

Bug Description

hermes update fails on systems where Hermes was installed via uv tool install hermes-agent, because _cmd_update_pip() runs uv pip install --upgrade hermes-agent which requires an active virtual environment.

Steps to Reproduce

  1. Install Hermes via uv tool install hermes-agent (standard install script)
  2. Run hermes update
  3. See error:
→ Running: /home/user/.local/bin/uv pip install --upgrade hermes-agent
error: No virtual environment found; run `uv venv` to create an environment, or pass `--system` to install into a non-virtual environment
✗ Update failed

Root Cause

In hermes_cli/main.py, function _cmd_update_pip() (line 7724):

uv = shutil.which("uv")
if uv:
    cmd = [uv, "pip", "install", "--upgrade", "hermes-agent"]

uv pip install requires a virtual environment, but uv tool install installs globally — there is no venv.

Fix

Detect the installation method and use the correct command:

uv = shutil.which("uv")
if uv:
    tool_check = subprocess.run(
        [uv, "tool", "list"],
        capture_output=True, text=True, timeout=15,
    )
    is_uv_tool = "hermes-agent" in tool_check.stdout
    if is_uv_tool:
        cmd = [uv, "tool", "upgrade", "hermes-agent"]
    else:
        cmd = [uv, "pip", "install", "--upgrade", "--system", "hermes-agent"]

Environment

  • OS: Linux (Debian)
  • Hermes version: 0.14.0
  • Installation method: standard install script (curl ... | bash)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardpython:uvPull requests that update python:uv codetype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions