Skip to content

Instantly share code, notes, and snippets.

@lee-pai-long
Created March 15, 2016 14:03
Show Gist options
  • Save lee-pai-long/32f23efd8af219367ea0 to your computer and use it in GitHub Desktop.
Save lee-pai-long/32f23efd8af219367ea0 to your computer and use it in GitHub Desktop.
Enable deadsnakes PPA, install Python 2.6, 2.7, 3.2 and 3.3, install easy_install and pip in to those versions
#!/usr/bin/env bash
sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O /tmp/ez_setup.py
py_ver=`python -c 'import sys; print ".".join(str(x) for x in sys.version_info[:2])'`
for i in 2.6 2.7 3.2 3.3
do
if [ "$i" != "$py_ver" ]
then
sudo apt-get -y install python$i python$i-dev
sudo python$i /tmp/ez_setup.py
sudo easy_install-$i pip
else
echo "Default Python version is $i, installing dev libraries and pip only"
sudo apt-get install -y python$-dev
sudo python$i /tmp/ez_setup.py
sudo easy_install-$i pip
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment