douyinWEB/desktop/scripts/ensure-python.ps1
Eric 960a268fa2 Make desktop the sole Windows client with unmanned live and boot/poll hardening.
Consolidate Douyin→YouTube RTMPS into /live, parallel local service boot, poll-only realtime, slimmer packs/charts, and deprecate youtube-live-win.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-23 14:10:07 +01:00

20 lines
758 B
PowerShell

# Ensure Windows Python can import backend (tzdata for Asia/Shanghai, etc.)
$ErrorActionPreference = "Stop"
$RepoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
$Req = Join-Path $RepoRoot "backend\requirements.txt"
Write-Host "Checking Python backend deps..."
python -c "from zoneinfo import ZoneInfo; ZoneInfo('Asia/Shanghai'); import fastapi" 2>$null
if ($LASTEXITCODE -eq 0) {
Write-Host "Python deps OK (skip pip)"
exit 0
}
Write-Host "Installing backend requirements..."
if (Test-Path $Req) {
python -m pip install -r $Req
} else {
python -m pip install "tzdata>=2024.1" "fastapi==0.115.6" "uvicorn[standard]==0.34.0"
}
python -c "from zoneinfo import ZoneInfo; ZoneInfo('Asia/Shanghai'); import fastapi; print('Python deps OK')"