diff --git a/start_server.sh b/start_server.sh index 8011f321..78639092 100755 --- a/start_server.sh +++ b/start_server.sh @@ -104,15 +104,17 @@ if [[ ! -f "requirements.txt" ]]; then log_error "backend/requirements.txt not found" fi -# Create and use Python virtual environment -VENV_DIR="../.venv" +# Create and use Python virtual environment in project root +VENV_DIR=".venv" if [[ ! -d "$VENV_DIR" ]]; then log_info " Creating Python virtual environment..." + cd - > /dev/null || true # Return to project root python3 -m venv "$VENV_DIR" || log_error "Failed to create virtual environment" + cd backend || log_error "Failed to enter backend directory" fi -# Activate virtual environment -source "$VENV_DIR/bin/activate" +# Activate virtual environment (from project root) +source "../$VENV_DIR/bin/activate" # Install dependencies if needed if ! python3 -c "import fastapi" &> /dev/null; then