windows 11 powershell 安装 python3.12.9
·
直接在 PowerShell中 :
$ver = "3.12.9"
$url = "https://www.python.org/ftp/python/$ver/python-$ver-amd64.exe"
$exe = "$env:TEMP\python-$ver-amd64.exe"
Invoke-WebRequest -Uri $url -OutFile $exe
Start-Process -FilePath $exe -ArgumentList `
"/quiet","InstallAllUsers=1","PrependPath=1","Include_pip=1","Include_launcher=1" -Wait
Remove-Item $exe
# 刷新当前会话 PATH
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + `
[System.Environment]::GetEnvironmentVariable("Path","User")
python --version # 期望输出 Python 3.12.9
然后就成功安装了
更多推荐


所有评论(0)