Skip to content

[Bug]: install.sh silently aborts on macOS when uv-managed Python path contains spaces #3000

@DevenDucommun

Description

@DevenDucommun

Bug Description

The installer (scripts/install.sh) silently aborts during the check_python() function on macOS when uv python find returns a path containing spaces.

On macOS, uv installs and manages Python under ~/Library/Application Support/uv/python/.... The space in "Application Support" causes the script to fail with exit code 127 and no error message (due to set -e), making it very difficult to diagnose.

Steps to Reproduce

  1. On macOS, have Python 3.11 managed by uv (installed to ~/Library/Application Support/uv/python/cpython-3.11.x-macos-aarch64-none/bin/python3.11)
  2. Ensure Python 3.11 is not available at a path without spaces (e.g., not in /opt/homebrew/bin/)
  3. Run: curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
  4. Installer prints "Checking Python 3.11..." and then silently exits with code 127

Expected Behavior

The installer should detect the uv-managed Python and continue with the installation.

Actual Behavior

The script silently aborts after printing → Checking Python 3.11... with exit code 127. No error message is shown because set -e causes immediate termination.

Root Cause Analysis

In scripts/install.sh, the check_python() function on lines 218 and 227 uses $PYTHON_PATH without quotes:

# Line 217-218
PYTHON_PATH=$($UV_CMD python find "$PYTHON_VERSION")
PYTHON_FOUND_VERSION=$($PYTHON_PATH --version 2>/dev/null)  # ← unquoted

# Line 226-227
PYTHON_PATH=$($UV_CMD python find "$PYTHON_VERSION")
PYTHON_FOUND_VERSION=$($PYTHON_PATH --version 2>/dev/null)  # ← unquoted

When uv python find 3.11 returns a path like:

/Users/username/Library/Application Support/uv/python/cpython-3.11.13-macos-aarch64-none/bin/python3.11

Bash word-splits the unquoted variable on the space, attempting to execute /Users/username/Library/Application as a command → command not found → exit 127 → set -e aborts the entire script.

Proposed Fix

Quote $PYTHON_PATH on lines 218 and 227:

PYTHON_FOUND_VERSION=$("$PYTHON_PATH" --version 2>/dev/null)

This is a two-character fix (add quotes in two places). I verified this locally — patching these two lines allows the full installation to complete successfully.

Environment

  • OS: macOS 15.7.3 (Sequoia, Apple Silicon)
  • Python: 3.11.13 (uv-managed)
  • Hermes Version: 0.4.0 (2026.3.23) — installed via patched script
  • uv: 0.7.21
  • Affected Component: Setup / Installation
  • Platform: N/A (CLI only)

Disclosure: This issue was identified, diagnosed, and written by an AI agent (Claude, Anthropic) and reviewed by a human before submission.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardtype/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