From f7ccd56ec0c6048556be5914eb691355f96beb47 Mon Sep 17 00:00:00 2001 From: Smittix Date: Mon, 5 Jan 2026 13:24:49 +0000 Subject: [PATCH] Fix setup.sh venv detection on fresh Debian installs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Check for venv/bin/activate file instead of just venv directory - Add error handling when python3-venv package is not installed - Clean up incomplete venv directories from failed attempts - Provide helpful instructions to install python3-venv 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- setup.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 17d1e25..7a3db9f 100755 --- a/setup.sh +++ b/setup.sh @@ -81,7 +81,7 @@ install_python_deps() { if [ -n "$VIRTUAL_ENV" ]; then echo "Using virtual environment: $VIRTUAL_ENV" pip install -r requirements.txt - elif [ -d "venv" ]; then + elif [ -f "venv/bin/activate" ]; then echo "Found existing venv, activating..." source venv/bin/activate pip install -r requirements.txt @@ -97,7 +97,22 @@ install_python_deps() { echo "" echo -e "${YELLOW}System Python is externally managed (PEP 668).${NC}" echo "Creating virtual environment..." - python3 -m venv venv + + # Remove any incomplete venv directory from previous failed attempts + if [ -d "venv" ] && [ ! -f "venv/bin/activate" ]; then + echo "Removing incomplete venv directory..." + rm -rf venv + fi + + if ! python3 -m venv venv; then + echo -e "${RED}Error: Failed to create virtual environment${NC}" + echo "" + echo "On Debian/Ubuntu, install the venv module with:" + echo " sudo apt install python3-venv" + echo "" + echo "Then run this setup script again." + exit 1 + fi source venv/bin/activate pip install -r requirements.txt echo ""