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"
|
log_error "backend/requirements.txt not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create and use Python virtual environment
|
# Create and use Python virtual environment in project root
|
||||||
VENV_DIR="../.venv"
|
VENV_DIR=".venv"
|
||||||
if [[ ! -d "$VENV_DIR" ]]; then
|
if [[ ! -d "$VENV_DIR" ]]; then
|
||||||
log_info " Creating Python virtual environment..."
|
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"
|
python3 -m venv "$VENV_DIR" || log_error "Failed to create virtual environment"
|
||||||
|
cd backend || log_error "Failed to enter backend directory"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Activate virtual environment
|
# Activate virtual environment (from project root)
|
||||||
source "$VENV_DIR/bin/activate"
|
source "../$VENV_DIR/bin/activate"
|
||||||
|
|
||||||
# Install dependencies if needed
|
# Install dependencies if needed
|
||||||
if ! python3 -c "import fastapi" &> /dev/null; then
|
if ! python3 -c "import fastapi" &> /dev/null; then
|
||||||
|
|||||||
Reference in New Issue
Block a user