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

den*_*ufa 9 python windows installer windows-installer msiexec

使用静默安装程序(.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字节.

tah*_*oar 12

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

msiexec /i "python-2.7.11.amd64.msi" /passive /norestart ADDLOCAL=ALL
Run Code Online (Sandbox Code Playgroud)

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

  • 也许作者的意思是"重启提示"而不是系统.如上所述使用ADDLOCAL = ALL运行msiexec会在下一个cmd会话中成功将python引入PATH. (4认同)