fix: Handle Ubuntu 24.04 externally-managed Python environment

This commit is contained in:
devmatrix 2026-02-16 15:36:52 +00:00
parent 1c5b3f666a
commit da3dbff1c2
1 changed files with 11 additions and 2 deletions

View File

@ -79,9 +79,18 @@ sudo apt install -y nodejs
# PYTHON # PYTHON
# ============================================ # ============================================
log "📦 Installing Python development tools..." log "📦 Installing Python development tools..."
sudo apt install -y python3 python3-pip python3-venv python3-dev python-is-python3 sudo apt install -y python3 python3-pip python3-venv python3-dev python-is-python3 python3-full
pip3 install --user \ # Check if we need --break-system-packages (Ubuntu 24.04+)
if python3 -m pip --version 2>/dev/null | grep -q "externally-managed"; then
PIP_ARGS="--break-system-packages"
else
PIP_ARGS=""
fi
pip3 install $PIP_ARGS \
pipenv poetry pytest black flake8 mypy bandit pylint \
jupyter notebook requests || pip3 install --user \
pipenv poetry pytest black flake8 mypy bandit pylint \ pipenv poetry pytest black flake8 mypy bandit pylint \
jupyter notebook requests jupyter notebook requests