diff --git a/start_server.sh b/start_server.sh index 78ba96df..8011f321 100755 --- a/start_server.sh +++ b/start_server.sh @@ -104,6 +104,16 @@ if [[ ! -f "requirements.txt" ]]; then log_error "backend/requirements.txt not found" fi +# Create and use Python virtual environment +VENV_DIR="../.venv" +if [[ ! -d "$VENV_DIR" ]]; then + log_info " Creating Python virtual environment..." + python3 -m venv "$VENV_DIR" || log_error "Failed to create virtual environment" +fi + +# Activate virtual environment +source "$VENV_DIR/bin/activate" + # Install dependencies if needed if ! python3 -c "import fastapi" &> /dev/null; then log_info " Installing Python dependencies..."