Upgrading Python to Python 2.7 on Debian 6

Unix

23 Feb 2015

Upgrading Python to Python 2.7 on Debian 6

Preston Garrison 0 Comments

Unfortunately Debian 6 doesn’t let you upgrade to python 2.7.  This is a problem for me because 2.7 has added check_output function to subprocess.  If you see the following errors:

Traceback (most recent call last):
  File "/usr/local/bin/keyupdate.py", line 7, in <module>
    from subprocess import Popen, PIPE, check_output
ImportError: cannot import name check_output

 

That means you need to upgrade.  First you can add 

deb http://ftp.uk.debian.org/debian/ testing main contrib non-free

to /etc/apt/sources.list

 

then you simply:

apt-get update
apt-get -y upgrade
apt-get -y install python2.7

 

Preston Garrison