Cannot install "python-all" package, python2.4-minimal crashes saying i must use python2.5.

Bug #371017 reported by David Racine
8
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python2.4 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: python-all
version 2.4.5-5ubuntu1
I think my problem looks a lot like bug #75557
I can't install or uninstall python2.4-minimal. The application says that I must use python2.5. The error is:

ValueError: /usr/bin/python does not match the python default version. It must be reset to point to python2.5

But this is the version I use:

python -V
Python 2.5.2

This is when the error occured: I installed python3.0, then I wanted to use it so I typed:

sudo update-alternatives --install /usr/bin/python python python2.5 10
sudo update-alternatives --install /usr/bin/python python python3.0 20

After this, I tried to compile Blender with this new version. But it didn't work so I turned back to 2.5

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

After this I decided to install python-all package for no real reason, then the bug happened.

Ubuntu 8.10 amd64

ProblemType: Package
Architecture: amd64
Dependencies:

DistroRelease: Ubuntu 8.10
ErrorMessage: le sous-processus pre-installation script a retourné une erreur de sortie d'état 1
NonfreeKernelModules: ath_hal fglrx
Package: python-uno None [modified: /var/lib/dpkg/info/python-uno.list]
SourcePackage: openoffice.org
Title: package python-uno None [modified: /var/lib/dpkg/info/python-uno.list] failed to install/upgrade: le sous-processus pre-installation script a retourné une erreur de sortie d'état 1
Uname: Linux 2.6.27-11-generic x86_64

Revision history for this message
David Racine (bass-dr) wrote :
David Racine (bass-dr)
description: updated
description: updated
Revision history for this message
David Racine (bass-dr) wrote :

Ok I found a way to fix this, and the reason why it happened, maybe it will help someone!

the problem was: when I made my synlink with

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

update-altertative didn't write this path to the synlink, but: /etc/alternatives/python (I don't know why...) this is what confused python. In /usr/share/pycentral-data/pyversions.py, the script that checks if the right version of python is used, they search for python2.5 in "os.readlink" the return of readlink was: /etc/alternatives/python... no python2.5 in this string!

So how to fix this:

sudo python #open python in super-user mode
import os #we are in python now, so this import the os functions
os.unlink('/usr/bin/python') #remove the old link
os.symlink('/usr/bin/python','/usr/bin/python2.5') #make the new link, this is made by python itself, so it must work!!

this works fine for me, python now installs fine, and works fine too (with version 2.5 though...)

Revision history for this message
David Racine (bass-dr) wrote :

I made an error:
os.symlink('/usr/bin/python','/usr/bin/python2.5')

should be

os.symlink('python2.5','/usr/bin/python')

Revision history for this message
Gabriel (misc-evotex) wrote :

Hello, I have the same problem, but in Ubuntu 9.10 with Python 2.5 & 2.6 (ticket #501022). At least it looks the same. I don't get why the update-alternatives stuff is done by default when you install a second version of python

Revision history for this message
Matthias Klose (doko) wrote :

the /usr/bin/python symlink is not managed by alternatives

Changed in python2.4 (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.