win-install-python
Windows 安装 Python 编程语言
补充说明
Python 是一种简单易学、功能强大的编程语言,拥有丰富的标准库和第三方包支持,广泛应用于 Web 开发、数据分析和人工智能。
安装 Python
- CMD 下载命令
# 安装 Python
cd /d "%USERPROFILE%\Downloads" && curl.exe -L -o python-3.13.0-amd64.exe https://www.python.org/ftp/python/3.13.0/python-3.13.0-amd64.exe && python-3.13.0-amd64.exe /quiet InstallAllUsers=1 PrependPath=1
- PowerShell 下载命令
# 安装 Python
cd ~\Downloads; curl.exe -L -o python-3.13.0-amd64.exe https://www.python.org/ftp/python/3.13.0/python-3.13.0-amd64.exe; .\python-3.13.0-amd64.exe /quiet InstallAllUsers=1 PrependPath=1
winget 安装命令
推荐使用 winget 安装,自动处理依赖、静默后台执行
winget install -e --id Python.Python.3.13 -h --accept-package-agreements --accept-source-agreements
-e:精确匹配包 ID,杜绝装错-h:静默安装,不弹出向导窗口--accept-package-agreements:自动同意许可协议--accept-source-agreements:同意源协议,批量部署必备
使用前提
- 系统:Windows 11 / 10 1709+(自带 winget)
- 权限:以管理员身份运行 CMD,否则 UAC 中断自动化
- 网络:需正常联网
执行结果
- 未安装 → 自动下载 + 静默安装,无弹窗
- 已装同版本 → 提示已安装,不重复操作
- 已有旧版 → 不会自动升级,如需升级请运行
winget upgrade Python.Python.3.13