Created
February 18, 2015 21:10
-
-
Save jbnunn/a36322c31e2efae61f36 to your computer and use it in GitHub Desktop.
Python 2.7 on Amazon Linux AMI for EC2
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
# install build tools | |
sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y | |
# install python 2.7 and change default python symlink | |
sudo yum install python27-devel -y | |
sudo rm /usr/bin/python | |
sudo ln -s /usr/bin/python2.7 /usr/bin/python | |
# yum still needs 2.6, so write it in and backup script | |
sudo cp /usr/bin/yum /usr/bin/_yum_before_27 | |
sudo sed -i s/python/python2.6/g /usr/bin/yum | |
sudo sed -i s/python2.6/python2.6/g /usr/bin/yum | |
# should display now 2.7.5 or later: | |
python -V | |
# now install pip for 2.7 | |
sudo curl -o /tmp/ez_setup.py https://bootstrap.pypa.io/ez_setup.py | |
sudo /usr/bin/python27 /tmp/ez_setup.py | |
sudo /usr/bin/easy_install-2.7 pip | |
sudo pip install virtualenv | |
# should display current versions: | |
pip -V && virtualenv --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo /usr/bin/easy_install-2.7 pip
It does not work on my AMI