up vote 4 down vote favorite
2
share [g+] share [fb]

is it possible to set the default python to 2.6 for debian lenny somehow?

link|improve this question

feedback

2 Answers

up vote 1 down vote accepted

I'd just like to comment on Dennis Williamson's answer:

Using the command line provided for the "install" commands results in this error:

update-alternatives: error: alternative link is not absolute as it should be:
                            python2.5

it looks like the syntax to create the alternative would rather be:

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.5 1

Ie, the first parameter needs to be an absolute path, not just a name.

link|improve this answer
feedback

If alternatives are already set up:

update-alternatives --config python

then choose from the list that's presented.

If they're not set up, then do this:

  • If there is a symlink already set up, save it:

    sudo mv /usr/bin/python /usr/bin/pythonSAVE

  • create the alternatives

    sudo update-alternatives --install python2.6 python /usr/bin/python2.6 2

    sudo update-alternatives --install python2.5 python /usr/bin/python2.5 1

  • create a new symlink

    sudo ln -s /etc/alternatives/python /usr/bin/python

  • choose the one you want to use

    sudo update-alternatives --config python

link|improve this answer
Why wouldn't the alternatives be setup? – womble Sep 12 '09 at 5:56
I don't know. On my system, even though other programs were already set up, python wasn't despite the fact that I've got 2.5, 2.6 and 3.0 installed. – Dennis Williamson Sep 12 '09 at 7:38
I can say now that aptitude checks to ensure that python is a symlink to /usr/bin/python2.6. This bypasses the alternatives system. Perhaps that need for debian_default python, plus the availability virtualenv and buildout, are why python is not configured with alternatives. – Chiggsy Oct 18 '10 at 6:30
1  
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.