From 17b7354db87a046adf463e18cbca3a775a676285 Mon Sep 17 00:00:00 2001 From: Auto Date: Wed, 7 Jan 2026 09:45:54 +0200 Subject: [PATCH] fix: activate venv in UI launcher scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit start_ui.sh and start_ui.bat were using system Python directly, causing ModuleNotFoundError for dotenv. Now they create and activate the venv before running, matching the pattern in start.sh. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- start_ui.bat | 13 +++++++++++++ start_ui.sh | 15 ++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/start_ui.bat b/start_ui.bat index d412101..d53ca9c 100644 --- a/start_ui.bat +++ b/start_ui.bat @@ -18,6 +18,19 @@ if %ERRORLEVEL% neq 0 ( exit /b 1 ) +REM Check if venv exists, create if not +if not exist "venv" ( + echo Creating virtual environment... + python -m venv venv +) + +REM Activate the virtual environment +call venv\Scripts\activate.bat + +REM Install dependencies +echo Installing dependencies... +pip install -r requirements.txt --quiet + REM Run the Python launcher python "%~dp0start_ui.py" %* diff --git a/start_ui.sh b/start_ui.sh index 33adea0..644db74 100644 --- a/start_ui.sh +++ b/start_ui.sh @@ -21,5 +21,18 @@ else PYTHON_CMD="python3" fi +# Check if venv exists, create if not +if [ ! -d "venv" ]; then + echo "Creating virtual environment..." + $PYTHON_CMD -m venv venv +fi + +# Activate the virtual environment +source venv/bin/activate + +# Install dependencies +echo "Installing dependencies..." +pip install -r requirements.txt --quiet + # Run the Python launcher -$PYTHON_CMD start_ui.py "$@" +python start_ui.py "$@"