Skip to content

Instantly share code, notes, and snippets.

@sebsto
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebsto/2b7516a61db432ebe77c to your computer and use it in GitHub Desktop.
Save sebsto/2b7516a61db432ebe77c to your computer and use it in GitHub Desktop.
Install Python 2.7 on Amazon Linux 2014.03
#credits to: http://www.lecloud.net/post/61401763496/install-update-to-python-2-7-and-latest-pip-on-ec2
# install build tools (stick to a specific version to avoid environment drift)
# yum install -y make automake gcc gcc-c++ kernel-devel git
yum install -y make-1:3.81-20.7.amzn1.x86_64 \
automake-1.13.4-2.14.amzn1.noarch \
gcc48-4.8.2-7.87.amzn1.x86_64 \
gcc48-c++-4.8.2-7.87.amzn1.x86_64 \
kernel-devel-3.10.48-55.140.amzn1.x86_64 \
git-1.8.3.1-2.37.amzn1.x86_64
# install python 2.7 and change default python symlink
# yum install -y python27-devel
yum install -y python27-devel-2.7.5-13.35.amzn1.x86_64
rm -f /usr/bin/python
ln -s /usr/bin/python2.7 /usr/bin/python
# yum still needs 2.6, so write it in and backup script
cp /usr/bin/yum /usr/bin/yum.orig._before_27
sed -i s/python/python2.6/g /usr/bin/yum
# should display now 2.7.5 or later:
#python -V
# now install pip for 2.7
curl -o /tmp/ez_setup.py https://bootstrap.pypa.io/ez_setup.py
/usr/bin/python27 /tmp/ez_setup.py
/usr/bin/easy_install-2.7 pip
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