CI(windows): per-user Python install + robust python.exe path lookup
Build binaries / macos (push) Failing after 43s
Build binaries / windows (push) Failing after 1m19s
Build binaries / linux-amd64 (push) Failing after 1m47s
Build binaries / linux-arm64 (push) Failing after 1m46s

The installer's InstallAllUsers=1 needs admin (runner service isn't elevated)
so Python landed in the per-user LOCALAPPDATA dir, not C:\Program Files; the
hardcoded PATH prepend missed it -> 'python not recognized'. Switch to a
per-user install and locate python.exe across the known dirs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016yT89n4zR4qbrySoSiEyZs
This commit is contained in:
2026-06-30 16:20:02 -04:00
parent 0cc83884a5
commit 43dd739e3c
+9 -3
View File
@@ -18,11 +18,17 @@ jobs:
run: |
$ErrorActionPreference = "Stop"
if (-not (Get-Command python -ErrorAction SilentlyContinue)) {
Write-Host "Python not found; installing 3.12..."
Write-Host "Python not found; installing 3.12 (per-user, no admin needed)..."
$url = "https://www.python.org/ftp/python/3.12.7/python-3.12.7-amd64.exe"
Invoke-WebRequest -Uri $url -OutFile "$env:TEMP\py.exe"
Start-Process -Wait -FilePath "$env:TEMP\py.exe" -ArgumentList "/quiet","InstallAllUsers=1","PrependPath=1","Include_test=0"
$env:Path = "C:\Program Files\Python312;C:\Program Files\Python312\Scripts;$env:Path"
Start-Process -Wait -FilePath "$env:TEMP\py.exe" -ArgumentList "/quiet","PrependPath=1","Include_test=0"
$base = @(
"$env:LOCALAPPDATA\Programs\Python\Python312",
"C:\Program Files\Python312",
"C:\Python312"
) | Where-Object { Test-Path "$_\python.exe" } | Select-Object -First 1
if (-not $base) { throw "Python install did not produce python.exe in a known location" }
$env:Path = "$base;$base\Scripts;$env:Path"
}
python --version
python -m pip install --upgrade pip