fix: also check uv-managed Python 3.12 for AMD ROCm #5301
This commit is contained in:
parent
5deb230cfb
commit
bafb3f54df
1 changed files with 16 additions and 1 deletions
17
install.ps1
17
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue