用于免交互安装Python 3.10、卸载以及在部署工具中检测安装状态的命令。只列出确定可用的命令:来自清单文件,或来自安装程序技术的官方默认参数。
相关教程: 静默安装参数大全:MSI、NSIS、Inno Setup · 用注册表或PowerShell卸载程序
使用winget
PowerShell
winget install --id Python.Python.3.10 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Python.Python.3.10 -e --silentwinget uninstall --id Python.Python.3.10 -e --silent按安装包
64位 · EXE(WiX Burn) · 仅当前用户
静默安装
python-3.10.11-amd64.exe /quiet /norestart卸载
msiexec /x {A10FBB63-03FF-4B8C-A176-F5FD355F715B} /qn /norestart- MSI产品代码
- {a10fbb63-03ff-4b8c-a176-f5fd355f715b}
- 卸载注册表项
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{a10fbb63-03ff-4b8c-a176-f5fd355f715b}
- UpgradeCode
- {E3BAA187-CE22-5D2A-92E4-3290DEC0FCAB}
- DisplayVersion
- 3.10.11150.0
64位 · EXE(WiX Burn) · 所有用户
静默安装
python-3.10.11-amd64.exe /quiet /norestart卸载
msiexec /x {A10FBB63-03FF-4B8C-A176-F5FD355F715B} /qn /norestart- MSI产品代码
- {a10fbb63-03ff-4b8c-a176-f5fd355f715b}
- 卸载注册表项
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{a10fbb63-03ff-4b8c-a176-f5fd355f715b}
- UpgradeCode
- {E3BAA187-CE22-5D2A-92E4-3290DEC0FCAB}
- DisplayVersion
- 3.10.11150.0
32位 · EXE(WiX Burn) · 仅当前用户
静默安装
python-3.10.11.exe /quiet /norestart卸载
msiexec /x {24F90C01-2C0A-45DD-8619-2D1B68EB3D2B} /qn /norestart- MSI产品代码
- {24f90c01-2c0a-45dd-8619-2d1b68eb3d2b}
- 卸载注册表项
- HKCU\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{24f90c01-2c0a-45dd-8619-2d1b68eb3d2b}
- UpgradeCode
- {474D137A-11E9-5F9D-9D62-DF035A3DB588}
- DisplayVersion
- 3.10.11150.0
32位 · EXE(WiX Burn) · 所有用户
静默安装
python-3.10.11.exe /quiet /norestart卸载
msiexec /x {24F90C01-2C0A-45DD-8619-2D1B68EB3D2B} /qn /norestart- MSI产品代码
- {24f90c01-2c0a-45dd-8619-2d1b68eb3d2b}
- 卸载注册表项
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{24f90c01-2c0a-45dd-8619-2d1b68eb3d2b}
- UpgradeCode
- {474D137A-11E9-5F9D-9D62-DF035A3DB588}
- DisplayVersion
- 3.10.11150.0
PowerShell:下载、校验、安装
下载官方文件,校验SHA256后静默安装。
install-python-3-10.ps1
$url = 'https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe'
$sha256 = 'D8DEDE5005564B408BA50317108B765ED9C3C510342A598F9FD42681CBE0648B'
$file = Join-Path $env:TEMP 'python-3.10.11-amd64.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/quiet /norestart' -Wait install-python-3-10.ps1
$url = 'https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe'
$sha256 = 'D8DEDE5005564B408BA50317108B765ED9C3C510342A598F9FD42681CBE0648B'
$file = Join-Path $env:TEMP 'python-3.10.11-amd64.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/quiet /norestart' -Wait install-python-3-10.ps1
$url = 'https://www.python.org/ftp/python/3.10.11/python-3.10.11.exe'
$sha256 = 'BD115A575E86E61CEA9136C5A2C47E090BA484DC2DEE8B51A34111BB094266D5'
$file = Join-Path $env:TEMP 'python-3.10.11.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/quiet /norestart' -Wait install-python-3-10.ps1
$url = 'https://www.python.org/ftp/python/3.10.11/python-3.10.11.exe'
$sha256 = 'BD115A575E86E61CEA9136C5A2C47E090BA484DC2DEE8B51A34111BB094266D5'
$file = Join-Path $env:TEMP 'python-3.10.11.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/quiet /norestart' -Wait