From 569b78c1f96573584f27cd0025d945e2434d6de1 Mon Sep 17 00:00:00 2001 From: ygd58 Date: Wed, 25 Mar 2026 20:36:51 +0100 Subject: [PATCH] fix(setup): bootstrap pip with ensurepip when not available in venv before neutts install --- hermes_cli/setup.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hermes_cli/setup.py b/hermes_cli/setup.py index 7cdbeabe8e9..63a9372adf9 100644 --- a/hermes_cli/setup.py +++ b/hermes_cli/setup.py @@ -828,6 +828,19 @@ def _install_neutts_deps() -> bool: print_info("Installing neutts Python package...") print_info("This will also download the TTS model (~300MB) on first use.") print() + + # Ensure pip is available — some venvs are created without pip (e.g. Ubuntu 25.10) + try: + import importlib + if importlib.util.find_spec("pip") is None: + print_info("pip not found in venv — bootstrapping with ensurepip...") + subprocess.run([sys.executable, "-m", "ensurepip", "--upgrade"], check=True, timeout=30) + print_success("pip bootstrapped successfully") + except Exception as e: + print_warning(f"Could not bootstrap pip: {e}") + print_info("Try: python -m ensurepip --upgrade") + return False + try: subprocess.run( [sys.executable, "-m", "pip", "install", "-U", "neutts[all]", "--quiet"],