Hands free python setup on windows

Windows does not have package manager. Not sure why is that since Windows Marketplace is here since 2004… but that’s another story. So for silent/unattended python install you have to stick to scripting a little bit, but thanks to Powershell it’s quite simple.

(new-object System.Net.WebClient).DownloadFile("https://www.python.org/ftp/python/2.7.6/python-2.7.6.msi", "$pwdpython-2.7.6.msi"); msiexec /i python-2.7.6.msi TARGETDIR=C:Python27 /qn ALLUSERS=1
[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:Python27;C:Python27Scripts", "User")
(new-object System.Net.WebClient).DownloadFile("https://raw.github.com/pypa/pip/master/contrib/get-pip.py", "$pwdget-pip.py"); C:Python27python.exe get-pip.py virtualenv

Remove /qn ALLUSERS=1 to show installer UI.

(new-object System.Net.WebClient).DownloadFile("https://www.python.org/ftp/python/2.7.6/python-2.7.6.msi", "$pwdpython-2.7.6.msi"); msiexec /i python-2.7.6.msi TARGETDIR=C:Python27
[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:Python27;C:Python27Scripts", "User")
(new-object System.Net.WebClient).DownloadFile("https://raw.github.com/pypa/pip/master/contrib/get-pip.py", "$pwdget-pip.py"); C:Python27python.exe get-pip.py virtualenv
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s