Files
AI_A4000/video_worker/scripts/install_windows_env.ps1
2026-04-07 00:37:39 +08:00

32 lines
991 B
PowerShell

$ErrorActionPreference = "Stop"
$Root = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
Set-Location $Root
if (!(Get-Command py -ErrorAction SilentlyContinue) -and !(Get-Command python -ErrorAction SilentlyContinue)) {
throw "Python launcher (py) or python not found"
}
if (Test-Path .venv) {
Write-Host ".venv already exists, reusing"
} else {
if (Get-Command py -ErrorAction SilentlyContinue) {
py -3 -m venv .venv
} else {
python -m venv .venv
}
}
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt
if (!(Get-Command ffmpeg -ErrorAction SilentlyContinue)) {
Write-Warning "ffmpeg not found in PATH. Please install ffmpeg and ensure PATH is updated."
}
New-Item -ItemType Directory -Force outputs, runtime, runtime\logs, models\ltx, models\hunyuan | Out-Null
if (!(Test-Path .env)) { Copy-Item .env.example .env }
Write-Host "[OK] install completed"
Write-Host "next: .\\scripts\\run_server.ps1"