From bafb3f54df8996dd4fc0d5834f84b04b42f56bf4 Mon Sep 17 00:00:00 2001 From: LeoBorcherding Date: Fri, 8 May 2026 03:20:06 -0500 Subject: [PATCH] fix: also check uv-managed Python 3.12 for AMD ROCm #5301 --- install.ps1 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/install.ps1 b/install.ps1 index f2646ce092..1b668375d2 100644 --- a/install.ps1 +++ b/install.ps1 @@ -1304,7 +1304,7 @@ shell.Run cmd, 0, False } } catch {} } - # 2. Try PATH (catches uv-managed or manually placed python3.12 / python) + # 2. Try PATH (catches manually placed python3.12 / python) if (-not $py312) { foreach ($name in @("python3.12", "python3", "python")) { foreach ($cmd in @(Get-Command $name -All -ErrorAction SilentlyContinue)) { @@ -1322,6 +1322,21 @@ shell.Run cmd, 0, False if ($py312) { break } } } + # 3. Ask uv for its managed Python 3.12 (uv installs don't appear in PATH or py.exe) + if (-not $py312) { + $uvCmd = Get-Command uv -ErrorAction SilentlyContinue + if ($uvCmd) { + try { + $uvPy = (& $uvCmd.Source python find 3.12 2>$null | Out-String).Trim() + if ($uvPy -and (Test-Path $uvPy) -and -not (Test-IsCondaPython $uvPy)) { + $verOut = (& $uvPy --version 2>&1 | Out-String) + if ($verOut -match "Python 3\.12\.\d+") { + $py312 = @{ Version = "3.12"; Path = $uvPy } + } + } + } catch {} + } + } if ($py312) { $DetectedPython = $py312 substep "AMD ROCm detected -- switching to Python 3.12 (ROCm wheels are cp312-only)" "Cyan"