From da3dbff1c22e6498d9e932de3f6ed163bfad6912 Mon Sep 17 00:00:00 2001 From: devmatrix Date: Mon, 16 Feb 2026 15:36:52 +0000 Subject: [PATCH] fix: Handle Ubuntu 24.04 externally-managed Python environment --- setup_openclaw_dev.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/setup_openclaw_dev.sh b/setup_openclaw_dev.sh index ebd01d9..d7872e4 100644 --- a/setup_openclaw_dev.sh +++ b/setup_openclaw_dev.sh @@ -79,9 +79,18 @@ sudo apt install -y nodejs # PYTHON # ============================================ 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 \ jupyter notebook requests