scripts: detect and recreate broken venv (pip missing after python3-venv not installed)
Nightly Build / build (push) Successful in 6m28s

This commit is contained in:
2026-07-20 20:31:55 +01:00
parent 54949e2ca9
commit bd88f02226
4 changed files with 20 additions and 4 deletions
+5 -1
View File
@@ -256,7 +256,11 @@ info "🔧 Setting up Python virtual environment …"
VENV_DIR="${INSTALL_DIR}/.venv"
REQUIREMENTS="${INSTALL_DIR}/requirements.txt"
if [ ! -f "$VENV_DIR/bin/python3" ]; then
# A venv is usable only if python3 AND pip both work. Ubuntu's `python3 -m venv`
# without the python3-venv package leaves a venv with python3 but no pip — detect
# that and recreate, so a broken venv never survives a restart.
if [ ! -f "$VENV_DIR/bin/python3" ] || ! "$VENV_DIR/bin/python3" -m pip --version >/dev/null 2>&1; then
rm -rf "$VENV_DIR"
if command -v uv >/dev/null 2>&1; then
uv venv --seed "$VENV_DIR" && uv pip install -r "$REQUIREMENTS" \
&& info "✔ Python venv ready (uv)" \
+5 -1
View File
@@ -261,7 +261,11 @@ info "🔧 Setting up Python virtual environment …"
VENV_DIR="${INSTALL_DIR}/.venv"
REQUIREMENTS="${INSTALL_DIR}/requirements.txt"
if [ ! -f "$VENV_DIR/bin/python3" ]; then
# A venv is usable only if python3 AND pip both work. Ubuntu's `python3 -m venv`
# without the python3-venv package leaves a venv with python3 but no pip — detect
# that and recreate, so a broken venv never survives a restart.
if [ ! -f "$VENV_DIR/bin/python3" ] || ! "$VENV_DIR/bin/python3" -m pip --version >/dev/null 2>&1; then
rm -rf "$VENV_DIR"
if command -v uv >/dev/null 2>&1; then
uv venv --seed "$VENV_DIR" && uv pip install -r "$REQUIREMENTS" \
&& info "✔ Python venv ready (uv)" \
+5 -1
View File
@@ -11,7 +11,11 @@ cd "$(dirname "$0")"
VENV_DIR=".venv"
REQUIREMENTS="requirements.txt"
if [ ! -f "$VENV_DIR/bin/python3" ] && [ -f "$REQUIREMENTS" ]; then
# A venv is usable only if python3 AND pip both work. Ubuntu's `python3 -m venv`
# without the python3-venv package leaves a venv with python3 but no pip — detect
# that and recreate, so a broken venv never survives a restart.
if [ -f "$REQUIREMENTS" ] && { [ ! -f "$VENV_DIR/bin/python3" ] || ! "$VENV_DIR/bin/python3" -m pip --version >/dev/null 2>&1; }; then
rm -rf "$VENV_DIR"
if command -v uv >/dev/null 2>&1; then
echo "[run-docker.sh] Setting up Python venv with uv …"
uv venv --seed "$VENV_DIR" && uv pip install -r "$REQUIREMENTS" \
+5 -1
View File
@@ -50,7 +50,11 @@ fi
VENV_DIR=".venv"
REQUIREMENTS="requirements.txt"
if [ ! -f "$VENV_DIR/bin/python3" ]; then
# A venv is usable only if python3 AND pip both work. Ubuntu's `python3 -m venv`
# without the python3-venv package leaves a venv with python3 but no pip — detect
# that and recreate, so a broken venv never survives a restart.
if [ ! -f "$VENV_DIR/bin/python3" ] || ! "$VENV_DIR/bin/python3" -m pip --version >/dev/null 2>&1; then
rm -rf "$VENV_DIR"
if command -v uv >/dev/null 2>&1; then
echo "[run.sh] Setting up Python venv with uv …"
uv venv --seed "$VENV_DIR" && uv pip install -r "$REQUIREMENTS" \