param([string]$Config="$PSScriptRoot\config.json",[string]$Python) $ErrorActionPreference='Stop' if (-not $Python) { $cfg=Get-Content -LiteralPath $Config -Raw|ConvertFrom-Json; $base=Split-Path -Parent (Resolve-Path -LiteralPath $Config); $portable=Join-Path $base $cfg.paths.portable_root; $Python=Join-Path $portable 'python_embeded\python.exe' } if (-not (Test-Path -LiteralPath $Python)) { throw "Python not found at $Python; pass -Python explicitly" } & $Python -m pip install --target "$PSScriptRoot\.vendor" --upgrade -r "$PSScriptRoot\requirements-analysis.txt"; exit $LASTEXITCODE