Last active
April 2, 2022 22:11
-
-
Save rgbkrk/7271813 to your computer and use it in GitHub Desktop.
Powershell installation of python and pyrax on a fresh Rackspace Windows Server instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## NOTE: This script is a walkthrough and may not work if run directly. | |
## | |
## If downloaded to run, make sure to set | |
## | |
## Set-ExecutionPolicy RemoteSigned | |
## | |
# Create a downloader via .NET | |
$notwget = New-Object System.Net.WebClient | |
# We'll download and install | |
# - the Python 2.7 64-bit msi | |
# - ez_setup.py | |
# - get-pip.py | |
# Download and install Python 2.7 | |
$notwget.DownloadFile("http://www.python.org/ftp/python/2.7.6/python-2.7.6.amd64.msi", "$pwd\python-2.7.6.amd64.msi") | |
# Run the installer in non-interactive installation mode | |
& msiexec /i .\python-2.7.6.amd64.msi ALLUSERS=1 | |
# Install the latest and greatest version of Setuptools | |
$notwget.DownloadFile("https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py", "$pwd\ez_setup.py") | |
# Rather than muck with PATH and PYTHONPATH, simply did these installs directly | |
& "C:\Python27\python.exe" .\ez_setup.py | |
# Get pip! | |
$notwget.DownloadFile("https://raw.github.com/pypa/pip/master/contrib/get-pip.py", "$pwd\get-pip.py") | |
& "C:\Python27\python.exe" .\get-pip.py | |
# Because of an upstream issue in pbr, we install an old version of pbr first. | |
& "C:\Python27\Scripts\pip.exe" install pbr==0.5.21 | |
# Now can install pyrax | |
& "C:\Python27\Scripts\pip.exe" install pyrax |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment