feat(system): fix(setup): add ensurepip check to prevent broken venv on Debian/Ubuntu — closes #495

Co-Authored-By: @devpulse <devpulse@aipass>
This commit is contained in:
patrick
2026-05-03 08:57:18 -07:00
co-authored by @devpulse
parent dd39cb6835
commit a530c83a63
5 changed files with 18 additions and 8 deletions
+13
View File
@@ -133,6 +133,19 @@ if [ "$PY_OK" != "1" ]; then
fi
fi
# --- Check ensurepip (Debian/Ubuntu split it into python3-venv apt package) ---
if ! $PYTHON -c 'import ensurepip' &>/dev/null 2>&1; then
echo ""
echo "FAIL: ensurepip is unavailable for $PYTHON."
echo " Without it, 'python3 -m venv' creates a broken venv (no pip, no activate)."
echo ""
echo " Debian/Ubuntu: sudo apt install python3-venv python3-pip"
echo " Fedora/RHEL: sudo dnf install python3-pip"
echo " Arch: (included in base python — file a bug if you hit this)"
echo ""
exit 1
fi
# --- Create venv ---
if [ "$IS_WINDOWS" -eq 1 ] && [ -f ".venv/Scripts/python.exe" ]; then
# Windows: skip venv recreation if python.exe exists (rm -rf unreliable due to file locking)