Spaces:
Running
on
Zero
Running
on
Zero
File size: 1,749 Bytes
a28932a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# Direct Python API Runner (Windows)
# Bypasses Docker networking issues
Write-Host "π Starting Warbler CDA FractalStat API (Direct Python)" -ForegroundColor Green
Write-Host "======================================================" -ForegroundColor Green
Write-Host ""
# Check Python
try {
$pythonVersion = & python --version 2>&1
Write-Host "β
Python available: $pythonVersion" -ForegroundColor Green
} catch {
Write-Host "β Python not found. Install Python 3.11+" -ForegroundColor Red
exit 1
}
# Check if virtual environment is activated (optional)
if ($env:VIRTUAL_ENV) {
Write-Host "β
Virtual environment active: $($env:VIRTUAL_ENV)" -ForegroundColor Green
} else {
Write-Host "[Info] Consider activating virtual environment: .\venv\Scripts\Activate.ps1" -ForegroundColor Yellow
}
# Set environment variables
$env:FRACTALSTAT_TESTING = "true"
$env:PYTHONPATH = "$PWD"
Write-Host ""
Write-Host "π¦ Starting FastAPI server..." -ForegroundColor Cyan
Write-Host " Access at: http://localhost:8000" -ForegroundColor Yellow
Write-Host " Health check: http://localhost:8000/health" -ForegroundColor Yellow
Write-Host " API docs: http://localhost:8000/docs" -ForegroundColor Yellow
Write-Host ""
Write-Host "π Press Ctrl+C to stop the server" -ForegroundColor Red
Write-Host ""
# Run the API service directly with detailed error capture
Write-Host "π§ Starting API service with debug output..." -ForegroundColor Cyan
Write-Host " This will show import progress and any startup issues" -ForegroundColor Gray
Write-Host ""
try {
python start_server.py 2>&1
} catch {
Write-Host "β Error running API service:" -ForegroundColor Red
Write-Host $_.Exception.Message -ForegroundColor Red
}
|