fix: install.sh pipx-venv Erkennung — bin/python als erste Option

This commit is contained in:
Bernd (Hermes)
2026-07-14 15:21:06 +02:00
parent 3287d27579
commit d233969764
+21 -5
View File
@@ -236,7 +236,14 @@ load_lang() {
# das pip-Binary oft. Immer 'python3 -m pip' als Fallback nutzen (siehe unten).
_venv_install() {
local hermes_dir="$1" pkg="$2"
if [ -f "$hermes_dir/venv/bin/uv" ]; then
# pipx: ~/.local/share/pipx/venvs/hermes-agent/bin/python (kein venv/ Unterverzeichnis)
if [ -f "$hermes_dir/bin/uv" ]; then
"$hermes_dir/bin/uv" pip install "$pkg" 2>&1 | tail -1
elif [ -f "$hermes_dir/bin/pip" ]; then
"$hermes_dir/bin/pip" install "$pkg" 2>&1 | tail -1
elif [ -f "$hermes_dir/bin/python" ]; then
"$hermes_dir/bin/python" -m pip install "$pkg" 2>&1 | tail -1
elif [ -f "$hermes_dir/venv/bin/uv" ]; then
"$hermes_dir/venv/bin/uv" pip install "$pkg" 2>&1 | tail -1
elif [ -f "$hermes_dir/venv/bin/pip" ]; then
"$hermes_dir/venv/bin/pip" install "$pkg" 2>&1 | tail -1
@@ -359,6 +366,7 @@ find_hermes_dir() {
set +e
EXEC_PATH=$(systemctl --user show hermes-gateway -p ExecStart --value |
sed -n 's/.*path=\([^;]*\).*/\1/p' |
sed 's|/bin/python.*||' |
sed 's|/venv/bin/python.*||' |
sed 's|/.venv/bin/python.*||')
set -e
@@ -534,7 +542,9 @@ perform_update() {
# Verbesserung 3: numpy/faiss Import-Test
_UPD_PY=""
if [ -f "$hermes_dir/venv/bin/python" ]; then
if [ -f "$hermes_dir/bin/python" ]; then
_UPD_PY="$hermes_dir/bin/python"
elif [ -f "$hermes_dir/venv/bin/python" ]; then
_UPD_PY="$hermes_dir/venv/bin/python"
elif [ -f "$hermes_dir/.venv/bin/python" ]; then
_UPD_PY="$hermes_dir/.venv/bin/python"
@@ -786,7 +796,9 @@ perform_update_only() {
# Verbesserung 3: numpy/faiss Import-Test
_UO_PY=""
if [ -f "$hermes_dir/venv/bin/python" ]; then
if [ -f "$hermes_dir/bin/python" ]; then
_UO_PY="$hermes_dir/bin/python"
elif [ -f "$hermes_dir/venv/bin/python" ]; then
_UO_PY="$hermes_dir/venv/bin/python"
elif [ -f "$hermes_dir/.venv/bin/python" ]; then
_UO_PY="$hermes_dir/.venv/bin/python"
@@ -1230,7 +1242,9 @@ if [ "$RC_MULTIROOM" = "true" ]; then
# (z.B. wenn im falschen venv installiert). Test via venv-python.
echo "🔍 Teste numpy/faiss Import..."
_VENV_PY=""
if [ -f "$HERMES_DIR/venv/bin/python" ]; then
if [ -f "$HERMES_DIR/bin/python" ]; then
_VENV_PY="$HERMES_DIR/bin/python"
elif [ -f "$HERMES_DIR/venv/bin/python" ]; then
_VENV_PY="$HERMES_DIR/venv/bin/python"
elif [ -f "$HERMES_DIR/.venv/bin/python" ]; then
_VENV_PY="$HERMES_DIR/.venv/bin/python"
@@ -1397,7 +1411,9 @@ cd "$HERMES_DIR"
# "venv/bin/python" (relativ) geschrieben → Service-Start schlägt fehl.
# Lösung: Absoluten Pfad aus $HERMES_DIR ableiten (liefert z.B.
# /home/bernd/.hermes/hermes-agent/venv/bin/python).
if [ -f "$HERMES_DIR/venv/bin/python" ]; then
if [ -f "$HERMES_DIR/bin/python" ]; then
PYTHON="$HERMES_DIR/bin/python"
elif [ -f "$HERMES_DIR/venv/bin/python" ]; then
PYTHON="$HERMES_DIR/venv/bin/python"
elif [ -f "$HERMES_DIR/.venv/bin/python" ]; then
PYTHON="$HERMES_DIR/.venv/bin/python"