如何让 chocolatey install python2 进入自定义路径?

How to make chocolatey install python2 into custom path?

我正在使用 Chocolatey 安装 Python 2.7.11,它安装到 C:\tools\python2:

choco install python2 -y

有什么方法可以让 Python 安装到 C:\Python27 中吗?

是,覆盖 install arguments -

choco install python2 -y -o -ia "'/qn /norestart ALLUSERS=1 TARGETDIR=c:\Python27'"

或者您可以创建一个 Python27 文件夹,它将安装在那里。

请注意,这是通过阅读 chocolateyInstall.ps1 脚本确定的 - https://chocolatey.org/packages/python2#files