Matrix Bridge ModuleNotFoundError - Dependency Installation Fix #4
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Users connecting to Hermes via Matrix bridge encountered a
ModuleNotFoundError: No module named 'openai'error, preventing all Matrix communications with the agent.Status: ✅ Fixed (PR #3 pending merge)
Affected Service: Hermes Matrix Bridge
Severity: High (complete service outage for Matrix users)
Error Message
Root Cause Analysis
The Hermes gateway uses an isolated virtual environment at
/opt/hermes/.venvfor dependency management. The compose configuration had two critical issues:Issue 1: Wrong Installation Target
The entrypoint command installed packages to system Python:
But the gateway runs from the isolated venv:
System Python packages are not accessible from the isolated venv.
Issue 2: Ephemeral Virtual Environment
Even if packages were installed to the venv correctly, the venv directory was not mounted to persistent storage. Container restarts would wipe all installed dependencies, causing the error to reappear.
Solution Implemented
Changes Made
File:
/opt/data/infra/assets/compose/ai/compose.yml1. Corrected installation target:
2. Added persistent venv storage:
Technical Decisions
uvoverpipuv(modern, faster package manager)--systemflagmatrix-nio[encryption]Related Pull Requests
Deployment Instructions
After PR merge, deploy with:
The
reloadTriggersmechanism indocker_manager.nixwill detect the compose.yml hash change and recreate the container automatically.Verification Steps
Prevention Measures
For Future PRs
${VAR}references are intact after editsdocker execverification - Confirm imports work before testing end-to-endSkill Updates
Updated
gitea-create-pull-requestskill with:Timeline
References
/opt/data/skills/autonomous-ai-agents/hermes-agent/SKILL.md/opt/data/skills/devops/hermes-matrix-bridge-fix/SKILL.md/opt/data/infra/modules/nixos/services/docker_manager.nixHermes referenced this issue2026-05-01 01:38:33 +00:00