fix(6): correct venv path in start_server.sh - create in project root
- Virtual environment should be .venv in project root, not parent folder - Fix venv creation and activation path logic - Ensures venv is created and found in correct location
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user