public
Last active

install python 2.7 on debian 6

  • Download Gist
install_pytho27.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
#!/bin/sh
mkdir ~/down/
cd ~/down/
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
#tk8.4-dev
./configure --prefix=/opt/python27 --enable-shared
make
sudo make install
 
echo "/opt/python27/lib" | sudo tee -a /etc/ld.so.conf.d/python27.conf
sudo ldconfig
 
cd ~/down/
wget http://peak.telecommunity.com/dist/ez_setup.py
sudo /opt/python27/bin/python ez_setup.py
sudo /opt/python27/bin/
sudo /opt/python27/bin/easy_install-2.7 virtualenv
/opt/python27/bin/virtualenv ~/env
 
cat >> ~/.profile <<DELIM
if [ -d "\$HOME/env/bin" ] ; then
PATH="\$HOME/env/bin:\$PATH"
fi
DELIM
 
source ~/.profile
 
#echo follow to ~/.profile
#if [ -d "$HOME/env/bin" ] ; then
# PATH="$HOME/env/bin:$PATH"
#fi
#export PATH="$HOME/env/bin:$PATH"
 
sudo apt-get install libmysqlclient-dev
easy_install mysql-python
 
echo 'we are done....'

This made it easy for me to get the important unsupported py modules to build -- thank you.

Why echo "/opt/python27/lib" | sudo tee -a /etc/ld.so.conf.d/python27.conf ??

You'll need python-dev before this script will work.

Just like @aaronyo said, it worked like a charm for me too. Thanks!

Thanks. It's a good work!

Is that an error on line #22?

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.