Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Python3 to custom path using Chocolatey?

I'm installing Python 3 with Chocolatey, which installs into C:\ProgramData\chocolatey\lib\python3:

> choco install python3

Is there any way I can get Python3 to install into C:\Python35 instead?

I´m aware of this question which is related to Python 2 ... but here a different package is used thus the answer there does not help in this case.

like image 980
Wlad Avatar asked Aug 09 '16 09:08

Wlad


People also ask

Where does Chocolatey install python3?

While it's typically installed in a top-level directory, e.g. C:\Python37 or in %PROGRAMFILES%, e.g. C:\Program Files\Python37, Chocolatey tends to install it under C:\ProgramData\chocolatey or C:\Tools. If you want to avoid this behavior you'll probably want to install Python using the packages from python.org.


1 Answers

There is a possibility to override --installargs like this:

> choco install python3 -y --override --installarguments "'/quiet  InstallAllUsers=1 TargetDir=c:\Python35'"

You might see some (access denied) errors (guess Python 3.5.1 Package is broken) but overall it seems to work.

I recommend to create your own Package as there is a newer Python version 3.5.2 which is not in the public package feed on chocolatey.org yet

like image 167
Wlad Avatar answered Sep 20 '22 08:09

Wlad