mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 02:05:22 -04:00
macOS: use venv Python for setup and launch
After the venv is created, $PY still points to the Homebrew/system interpreter, which triggers PEP 668 (externally-managed-environment) on modern macOS. Introduce VENV_PY pointing at the venv's own interpreter and use it for all pip installs and the final uvicorn launch. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+4
-3
@@ -117,10 +117,11 @@ if [ ! -d venv ]; then
|
|||||||
echo "▶ Creating Python environment…"
|
echo "▶ Creating Python environment…"
|
||||||
"$PY" -m venv venv
|
"$PY" -m venv venv
|
||||||
fi
|
fi
|
||||||
|
VENV_PY="./venv/bin/python3"
|
||||||
echo "▶ Installing Python packages (first run downloads a few — can take a few minutes)…"
|
echo "▶ Installing Python packages (first run downloads a few — can take a few minutes)…"
|
||||||
"$PY" -m pip install --quiet --upgrade pip
|
"$VENV_PY" -m pip install --quiet --upgrade pip
|
||||||
# Not --quiet: this is the slow step, so show progress (and any real errors).
|
# Not --quiet: this is the slow step, so show progress (and any real errors).
|
||||||
"$PY" -m pip install -r requirements.txt
|
"$VENV_PY" -m pip install -r requirements.txt
|
||||||
|
|
||||||
# 4. First-run setup: creates data dirs and prints an initial admin password
|
# 4. First-run setup: creates data dirs and prints an initial admin password
|
||||||
# the first time (idempotent — does nothing if already set up). Suppress its
|
# the first time (idempotent — does nothing if already set up). Suppress its
|
||||||
@@ -179,4 +180,4 @@ if [ -n "$TAILSCALE_URL" ]; then
|
|||||||
fi
|
fi
|
||||||
echo " (this takes a few seconds; press Ctrl+C here to stop)"
|
echo " (this takes a few seconds; press Ctrl+C here to stop)"
|
||||||
echo
|
echo
|
||||||
"$PY" -m uvicorn app:app --host "$HOST" --port "$PORT"
|
"$VENV_PY" -m uvicorn app:app --host "$HOST" --port "$PORT"
|
||||||
|
|||||||
Reference in New Issue
Block a user