python 2.7 windows silent installer (.msi) - 设置路径的命令行选项?

标签 python windows installation windows-installer

当使用静默安装程序 (.msi) 在 Windows 上安装 python 2.7 时,是否有命令行选项将 Python 添加到路径环境变量,如 GUI 选项?

Python 3.5 安装程序默认包含一个选项 PrependPath=0,但是 Python 2.7 可以使用它吗?

https://docs.python.org/3/using/windows.html

这里似乎讨论了这个问题,但没有针对 Python 2.7 的解决方案?

https://bugs.python.org/issue3561

编辑


这个批处理命令太棒了!!!

setx\M PATH "%PATH%;C:\Python\Python27;C:\Python\Python27\Scripts"

但 setx 会将存储的 %PATH% 字符串截断为 1024 字节。

最佳答案

自 2.4 起,Python MSI 安装程序可以更新系统路径。只需将 ADDLOCAL=ALL 添加到命令行即可。在传播之前,您必须重新启动系统。

msiexec /i "python-2.7.11.amd64.msi" /passive /norestart ADDLOCAL=ALL

https://www.python.org/download/releases/2.4/msi/

关于python 2.7 windows silent installer (.msi) - 设置路径的命令行选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34214607/

相关文章:

c++ - SetWindowsHookEx WH_KEYBOARD_LL 右移不响应

Java SWT 库在 Windows 10 中的糟糕布局

java - neo4j 无法开始给出错误您正在使用不受支持的 Java 版本,请使用 Oracle HotSpot 1 .7

linux - 如何在没有 X 的 Linux 上安装 Oracle 11g?

c# - 创建安装项目时如何使用最终的 {project}.exe.config 文件

python - 我可以匿名使用 boto3 吗?

python - 在 pandas 数据框中查找包含 inf 的单元格的行位置和列名

python - 我如何了解运行此 Python 程序时遇到的错误?

python - pytorch 为从 numpy 创建张量做了什么

c - 开机时自动启动进程