Wednesday, April 21, 2010

Python 2.6 on Debian

Debian 5.0 comes with Python 2.5 since there is no newer version available in stable repository yet. So the question becomes how you can install a newer Python on your box. Usual way is to update from sid repository and install python version you need... but it doesn't work that way, unfortunately. You will see the following error:
pycentral rtinstall: installed runtime python2.6 not found
The only way to get rid of this error is by removing older version of python (please note that updating python 2.5 to latest version will not work).
  1. apt-get remove python2.5-minimal python2.5
  2. rm -Rf /usr/bin/python /usr/bin/python2.5 /usr/lib/python2.4 /usr/lib/python2.5 /etc/python2.5
  3. add sid repository, e.g. deb http://ftp.us.debian.org/debian/ sid main, to /etc/apt/sources.list
  4. apt-get -y update
  5. apt-get -y install python python-setuptools python-virtualenv
  6. comment out sid repository in /etc/apt/sources.list
  7. apt-get -y update
  8. ln -s /usr/bin/python2.6 /usr/bin/python
  9. python --version
That's it.

No comments :

Post a Comment