用于免交互安装Python 3.11、卸载以及在部署工具中检测安装状态的命令。只列出确定可用的命令:来自清单文件,或来自安装程序技术的官方默认参数。
相关教程: 静默安装参数大全:MSI、NSIS、Inno Setup · 用注册表或PowerShell卸载程序
使用winget
PowerShell
winget install --id Python.Python.3.11 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Python.Python.3.11 -e --silentwinget uninstall --id Python.Python.3.11 -e --silent按安装包
64位 · EXE(WiX Burn) · 仅当前用户
静默安装
python-3.11.9-amd64.exe /quiet /norestart卸载
msiexec /x {1DA2E09B-199C-4DEF-9A99-93A8C1B8DDF2} /qn /norestart- MSI产品代码
- {1da2e09b-199c-4def-9a99-93a8c1b8ddf2}
- 卸载注册表项
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1da2e09b-199c-4def-9a99-93a8c1b8ddf2}
- UpgradeCode
- {767B31EB-0106-5AE3-B46E-77F32D1BABA2}
- DisplayVersion
- 3.11.9150.0
64位 · EXE(WiX Burn) · 所有用户
静默安装
python-3.11.9-amd64.exe /quiet /norestart卸载
msiexec /x {1DA2E09B-199C-4DEF-9A99-93A8C1B8DDF2} /qn /norestart- MSI产品代码
- {1da2e09b-199c-4def-9a99-93a8c1b8ddf2}
- 卸载注册表项
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1da2e09b-199c-4def-9a99-93a8c1b8ddf2}
- UpgradeCode
- {767B31EB-0106-5AE3-B46E-77F32D1BABA2}
- DisplayVersion
- 3.11.9150.0
ARM64 · EXE(WiX Burn) · 仅当前用户
静默安装
python-3.11.9-arm64.exe /quiet /norestart卸载
msiexec /x {3C1B70E3-48E4-4D2A-B16C-FC68485D2959} /qn /norestart- MSI产品代码
- {3c1b70e3-48e4-4d2a-b16c-fc68485d2959}
- 卸载注册表项
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3c1b70e3-48e4-4d2a-b16c-fc68485d2959}
- UpgradeCode
- {67E89A38-DE2D-5EC8-8C94-43166EFC6CF3}
- DisplayVersion
- 3.11.9150.0
ARM64 · EXE(WiX Burn) · 所有用户
静默安装
python-3.11.9-arm64.exe /quiet /norestart卸载
msiexec /x {3C1B70E3-48E4-4D2A-B16C-FC68485D2959} /qn /norestart- MSI产品代码
- {3c1b70e3-48e4-4d2a-b16c-fc68485d2959}
- 卸载注册表项
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3c1b70e3-48e4-4d2a-b16c-fc68485d2959}
- UpgradeCode
- {67E89A38-DE2D-5EC8-8C94-43166EFC6CF3}
- DisplayVersion
- 3.11.9150.0
32位 · EXE(WiX Burn) · 仅当前用户
静默安装
python-3.11.9.exe /quiet /norestart卸载
msiexec /x {B047D2A0-FE22-4D51-AE4C-4FC15FB14B31} /qn /norestart- MSI产品代码
- {b047d2a0-fe22-4d51-ae4c-4fc15fb14b31}
- 卸载注册表项
- HKCU\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{b047d2a0-fe22-4d51-ae4c-4fc15fb14b31}
- UpgradeCode
- {C2007350-35A9-53B8-9AC1-4EB4C04802E2}
- DisplayVersion
- 3.11.9150.0
32位 · EXE(WiX Burn) · 所有用户
静默安装
python-3.11.9.exe /quiet /norestart卸载
msiexec /x {B047D2A0-FE22-4D51-AE4C-4FC15FB14B31} /qn /norestart- MSI产品代码
- {b047d2a0-fe22-4d51-ae4c-4fc15fb14b31}
- 卸载注册表项
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{b047d2a0-fe22-4d51-ae4c-4fc15fb14b31}
- UpgradeCode
- {C2007350-35A9-53B8-9AC1-4EB4C04802E2}
- DisplayVersion
- 3.11.9150.0
PowerShell:下载、校验、安装
下载官方文件,校验SHA256后静默安装。
install-python-3-11.ps1
$url = 'https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe'
$sha256 = '5EE42C4EEE1E6B4464BB23722F90B45303F79442DF63083F05322F1785F5FDDE'
$file = Join-Path $env:TEMP 'python-3.11.9-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-11.ps1
$url = 'https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe'
$sha256 = '5EE42C4EEE1E6B4464BB23722F90B45303F79442DF63083F05322F1785F5FDDE'
$file = Join-Path $env:TEMP 'python-3.11.9-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-11.ps1
$url = 'https://www.python.org/ftp/python/3.11.9/python-3.11.9-arm64.exe'
$sha256 = '58F3A4E91B63D5A680ECC77C1DB4565A1E3966E8656D4C8B89200D58C1F5C4F3'
$file = Join-Path $env:TEMP 'python-3.11.9-arm64.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-11.ps1
$url = 'https://www.python.org/ftp/python/3.11.9/python-3.11.9-arm64.exe'
$sha256 = '58F3A4E91B63D5A680ECC77C1DB4565A1E3966E8656D4C8B89200D58C1F5C4F3'
$file = Join-Path $env:TEMP 'python-3.11.9-arm64.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-11.ps1
$url = 'https://www.python.org/ftp/python/3.11.9/python-3.11.9.exe'
$sha256 = 'AF19E5E2F03E715A822181F2CB7D4EFEF4EDA13FA4A2DB6DA12E998E46F5CBF9'
$file = Join-Path $env:TEMP 'python-3.11.9.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-11.ps1
$url = 'https://www.python.org/ftp/python/3.11.9/python-3.11.9.exe'
$sha256 = 'AF19E5E2F03E715A822181F2CB7D4EFEF4EDA13FA4A2DB6DA12E998E46F5CBF9'
$file = Join-Path $env:TEMP 'python-3.11.9.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