Skip to content

Instantly share code, notes, and snippets.

@roramirez
Forked from srusskih/install_pytho27.sh
Last active August 29, 2015 14:23
Show Gist options
  • Save roramirez/ce786fcf72f1226d83ad to your computer and use it in GitHub Desktop.
Save roramirez/ce786fcf72f1226d83ad to your computer and use it in GitHub Desktop.
#!/bin/sh
VERSION=2.7.10
cd /tmp/
sudo apt-get install build-essential
wget http://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz
tar -xzf Python-$VERSION.tgz
cd Python-$VERSION
sudo apt-get install libsqlite3-dev zlib1g-dev libncurses5-dev
sudo apt-get install libgdbm-dev libbz2-dev libreadline5-dev
sudo apt-get install libssl-dev libdb-dev
./configure --enable-shared
make
sudo make install
sudo ldconfig
sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python2.7 10
# copy package from prev env, case some packages need recomplation
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
sudo easy_install pip
/usr/bin/python2.6 pip freeze > freeze.txt
while read p; do
sudo pip install --upgrade $p
done < freeze.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment