Skip to content

Instantly share code, notes, and snippets.

@srusskih
Forked from ftao/install_pytho27.sh
Created October 29, 2012 13:08
Show Gist options
  • Save srusskih/3973440 to your computer and use it in GitHub Desktop.
Save srusskih/3973440 to your computer and use it in GitHub Desktop.
update to python 2.7 on debian 6
#!/bin/sh
cd /tmp/
sudo apt-get install build-essential
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar -xzf Python-2.7.2.tgz
cd Python-2.7.2
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