Skip to content

Instantly share code, notes, and snippets.

Created July 7, 2011 10:00
  • Star 27 You must be signed in to star a gist
  • Fork 19 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ftao/1069219 to your computer and use it in GitHub Desktop.
install python 2.7 on debian 6
mkdir ~/down/
cd ~/down/
sudo apt-get install build-essential
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 --prefix=/opt/python27 --enable-shared
sudo make install
echo "/opt/python27/lib" | sudo tee -a /etc/
sudo ldconfig
cd ~/down/
sudo /opt/python27/bin/python
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
source ~/.profile
#echo follow to ~/.profile
#if [ -d "$HOME/env/bin" ] ; then
# PATH="$HOME/env/bin:$PATH"
#export PATH="$HOME/env/bin:$PATH"
sudo apt-get install libmysqlclient-dev
easy_install mysql-python
echo 'we are done....'
Copy link

aaronyo commented Jan 16, 2012

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

Copy link

avinash commented May 13, 2012


Copy link

lajarre commented Oct 8, 2012

Why echo "/opt/python27/lib" | sudo tee -a /etc/ ??

Copy link

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

Copy link

embs commented Jan 21, 2013

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

Copy link

Thanks. It's a good work!

Copy link

Aidanie commented Aug 25, 2013


Copy link

romanr commented Feb 6, 2014

Is that an error on line #22?

Copy link

Thanks a lot ! U rule !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment