Korrigiere venv-Prüfung: Prüfe ensurepip statt venv-Modul

- Ändere Prüfung von "import venv" zu "import ensurepip"
- ensurepip ist die kritische Komponente die im Fehler fehlte
- Füge Verifikation nach Installation hinzu
- Skript bricht ab wenn Installation fehlschlägt
This commit is contained in:
2026-02-23 12:56:15 +01:00
parent dd5f787af7
commit 92490dd2d7

View File

@@ -55,8 +55,9 @@ print_success "Python gefunden: $PYTHON_VERSION"
# Prüfe und installiere python3-venv wenn nötig
print_step "Prüfe venv-Installation..."
if ! python3 -c "import venv" 2>/dev/null; then
print_warning "venv ist nicht installiert. Installation wird versucht..."
# Prüfe ob ensurepip verfügbar ist (wird für venv benötigt)
if ! python3 -c "import ensurepip" 2>/dev/null; then
print_warning "ensurepip ist nicht verfügbar. Installation von python3-venv erforderlich..."
# Erkenne Distribution
if [ -f /etc/debian_version ]; then
@@ -84,6 +85,12 @@ if ! python3 -c "import venv" 2>/dev/null; then
print_error "Distribution nicht erkannt. Bitte installieren Sie python3-venv manuell."
exit 1
fi
# Verifiziere Installation
if ! python3 -c "import ensurepip" 2>/dev/null; then
print_error "Installation von $VENV_PACKAGE fehlgeschlagen!"
exit 1
fi
print_success "venv installiert"
else
print_success "venv ist bereits installiert"