|sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev|
|tar -xzf Python-2.7.3.tgz|
|./configure --prefix=/usr --enable-shared|
|sudo make install|
|sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 20|
|sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10|
|sudo update-alternatives --set python /usr/bin/python2.6|
|sudo python2.7 ez_setup.py|
|sudo easy_install-2.7 virtualenv|
This is not a good way to install Python on Debian. Chances are Python is already installed. The current stable release (Wheezy) comes with packages for "python2.7" and "python2.6".
On line 7 "--prefix=/usr" means "write over the files managed by my Debian packages". This is definitely something that apt tools will complain about, and next time the Python packages are updated the manually installed versions will be overwritten. /usr/local is where custom compiled software belongs on a Debian system.
If you're trying to get Python working in Debian, try the official Debian packages from the repositories first. The above method is bound to break something, if not now then at update time.
I agree with deptadapt only for version 2.7.3 because that is the release available to Debian. I would definitely install it in a different directory, so you don't overwrite the distribution's package contents (You will start seeing lots of errors!). See here for ideas on installing multiple versions: http://www.extellisys.com/articles/python-on-debian-wheezy
However, this was useful to me for setting up 2.7.8, which is the current version available from Python.org.
Also, check out "virtualenvwrapper" for your virtualenv setups, as it has a few extra features (http://virtualenvwrapper.readthedocs.org/en/latest/). Note, you still need to install virtualenv first.
Hello again. I would like to ask that you remove this gist because it is profoundly bad advice for a Debian system.
Software installed locally should go to /usr/local. Only software installed by the package manager should live in /usr. The instructions here will conflict with upgrades from the package manager and leave the system in a broken state.
Please consider removing or correcting this gist. This is the second time I've encountered someone on IRC who has broken their Debian system following these instructions.
I get all this crap appearing:
Reading package lists... Done
dpkg: error processing python-minimal (--configure):
dpkg: error processing python2.7 (--configure):
dpkg: error processing python (--configure):
dpkg: error processing python-cheetah (--configure):
dpkg: error processing python-configobj (--configure):
dpkg: error processing python-feedparser (--configure):
dpkg: error processing python-pkg-resources (--configure):
Just an update: