hermes - ✅(Solved) Fix fix(update): auto-create venv if missing during hermes update [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#15565Fetched 2026-04-26 05:26:35
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×3cross-referenced ×1

Error Message

error: Failed to inspect Python interpreter from active virtual environment at venv/bin/python3 Caused by: Python interpreter not found at /path/to/hermes-agent/venv/bin/python3

Root Cause

error: Failed to inspect Python interpreter from active virtual environment at `venv/bin/python3`
  Caused by: Python interpreter not found at `/path/to/hermes-agent/venv/bin/python3`

Fix Action

Fixed

PR fix notes

PR #15566: fix(update): auto-create virtual environment if missing during update

Description (problem / solution / changelog)

Summary

This PR fixes the issue where hermes update fails when the Python virtual environment is missing or corrupted.

Changes

  • Added venv existence check before installing Python dependencies
  • Automatically creates venv using python -m venv if not found
  • Uses venv's Python interpreter for pip operations (non-uv mode)
  • Provides clear user feedback when creating new venv

Testing

  1. Remove venv: rm -rf venv
  2. Run hermes update
  3. Verify venv is created and dependencies are installed successfully

Related Issues

Fixes: #15565

Changed files

  • hermes_cli/main.py (modified, +25/-3)

Code Example

error: Failed to inspect Python interpreter from active virtual environment at `venv/bin/python3`
  Caused by: Python interpreter not found at `/path/to/hermes-agent/venv/bin/python3`
RAW_BUFFERClick to expand / collapse

Bug Description

When running hermes update, if the Python virtual environment (venv) is missing or corrupted, the update fails with:

error: Failed to inspect Python interpreter from active virtual environment at `venv/bin/python3`
  Caused by: Python interpreter not found at `/path/to/hermes-agent/venv/bin/python3`

This happens when:

  • User switches branches and venv gets cleaned up
  • venv is accidentally deleted
  • Fresh clone without venv initialization

Steps to Reproduce

  1. Remove the venv directory: rm -rf ~/.hermes/hermes-agent/venv
  2. Run hermes update
  3. Observe the error during "Updating Python dependencies..." phase

Expected Behavior

The update script should detect missing venv and automatically create it before attempting to install dependencies.

Actual Behavior

Update fails with "Python interpreter not found" error.

Environment

  • OS: Linux/macOS/WSL2
  • Hermes version: latest main
  • Python: 3.11+

Proposed Solution

Add venv existence check in hermes_cli/main.py before installing dependencies. If venv doesn't exist, create it automatically using python -m venv.

extent analysis

TL;DR

The most likely fix is to add a check for the existence of the Python virtual environment (venv) in the hermes_cli/main.py file and create it automatically if it's missing before installing dependencies.

Guidance

  • Check if the venv directory exists before running hermes update to prevent the error.
  • Modify the hermes_cli/main.py file to include a check for the venv directory and create it using python -m venv if it's missing.
  • Verify that the venv directory is properly initialized and activated before attempting to install dependencies.
  • Consider adding a try-except block to handle cases where the venv creation fails.

Example

import os
import subprocess

# Check if venv directory exists
venv_dir = os.path.join('~', '.hermes', 'hermes-agent', 'venv')
if not os.path.exists(venv_dir):
    # Create venv directory if it's missing
    subprocess.run(['python', '-m', 'venv', venv_dir])

Notes

This solution assumes that the python command is available in the system's PATH and that the venv module is installed. Additionally, this fix may not work if there are other issues with the hermes installation or configuration.

Recommendation

Apply the proposed solution by modifying the hermes_cli/main.py file to include the venv existence check and creation logic, as this will provide a more robust and automated solution to the problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING