Don't nuke venv on activation - preserve installed packages

This commit is contained in:
Celes Renata
2025-11-30 14:50:50 -08:00
parent 7ac9d8163c
commit b714a81ae5
+6 -8
View File
@@ -21,10 +21,12 @@ let
# Create directory structure
mkdir -p "$(dirname "$VENV_PATH")"
# Remove existing venv if it exists
if [[ -d "$VENV_PATH" ]]; then
echo "🗑 Removing existing virtual environment..."
rm -rf "$VENV_PATH"
# Only create venv if it doesn't exist
if [[ ! -d "$VENV_PATH" ]]; then
echo "🏗 Creating Python 3.12 virtual environment..."
${pkgs.python312}/bin/python -m venv "$VENV_PATH" --prompt .venv
else
echo " Virtual environment already exists at $VENV_PATH"
fi
# Set up proper library path for Python packages (64-bit only)
@@ -48,10 +50,6 @@ let
echo "📚 Library path: $LD_LIBRARY_PATH"
# Create virtual environment with Python 3.12 (installer requirement)
echo "🏗 Creating Python 3.12 virtual environment..."
${pkgs.python312}/bin/python -m venv "$VENV_PATH" --prompt .venv
# Activate and install exact requirements from installer
echo "📦 Installing Python packages with proper library linking..."
source "$VENV_PATH/bin/activate"