sudo update-alternatives does not configure the default python-wxgtk in Jaunty

Bug #379573 reported by Stani
36
This bug affects 5 people
Affects Status Importance Assigned to Milestone
wxwidgets2.6 (Ubuntu)
Fix Released
Undecided
Unassigned
Lucid
Fix Released
Undecided
Unassigned
wxwidgets2.8 (Ubuntu)
Fix Released
Undecided
Unassigned
Lucid
Fix Released
Undecided
Unassigned

Bug Description

In Jaunty, when both python-wxgtk2.6 and python-wxgtk2.8 are installed, this happens by default:
>>> import wx
>>> wx.VERSION
(2, 6, 3, 2, '')

In Intrepid, this happens by default:
>>> import wx
>>> wx.VERSION
(2, 8, 8, 0, '')

This switch might be unexpected by programs which run fine under intrepid and depend on 2.8. (In the ideal scenario they should choose the right version with wxversion.)

Moreover in Jaunty 2.8 seems to be configured as the default:
$ ls /etc/alternatives | grep wx
wx2.5.pth
wx2.6.pth
$ sudo update-alternatives --config wx2.6.pth
[sudo] password for stani:

Er zijn 2 alternatieven die 'wx2.6.pth' voorzien.

  Selectie Alternatieven
-----------------------------------------------
*+ 1 /usr/lib/wx/python/wx2.8.pth
          2 /usr/lib/wx/python/wx2.6.pth

So with "update-alternatives" I can't select that "import wx", imports wxPython 2.8

In Debian this looks right:
$ sudo update-alternatives --config wx.pth
There are 2 choices for the alternative wx.pth (providing /usr/lib/wx/python/wx.pth).

  Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/wx/python/wx2.6.pth 26 auto mode
  1 /usr/lib/wx/python/wx2.6.pth 26 manual mode
  2 /usr/lib/wx/python/wx2.8.pth 25 manual mode

When 2 is selected, wx 2.8 will be the default version (in Debian):
>>> import sys, wx
>>> print wx.VERSION
(2, 8, 7, 1, '')
>>> print sys.path
['', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/PIL', '/usr/lib/python2.5/site-packages/gst-0.10', '/usr/lib/pymodules/python2.5', '/usr/lib/pymodules/python2.5/gtk-2.0', '/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode']

In Jaunty if I look to wx.pth:
$ cat /usr/lib/python2.6/dist-packages/wx.pth
wx-2.8-gtk2-unicode

In Jaunty many wx*.pth are added in comparison to Intrepid (but this is probably irrelevant):
$ locate .pth | grep wx
/etc/alternatives/wx2.5.pth
/etc/alternatives/wx2.6.pth
/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode.pth
/usr/lib/python2.5/site-packages/wx.pth
/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx.pth
/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode.pth
/usr/lib/python2.6/dist-packages/wx.pth
/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx.pth
/usr/lib/wx/python/wx2.8.pth
/usr/share/pyshared/wx-2.8-gtk2-unicode.pth
/usr/share/pyshared/wx-2.8-gtk2-unicode/wx.pth
/var/lib/dpkg/alternatives/wx2.5.pth
/var/lib/dpkg/alternatives/wx2.6.pth

In Intrepid this gives:
$ locate .pth | grep wx
/etc/alternatives/wx2.4.pth
/etc/alternatives/wx2.5.pth
/usr/lib/python2.4/site-packages/wx.pth
/usr/lib/python2.5/site-packages/wx.pth
/usr/lib/wx/python/wx2.6.pth
/usr/lib/wx/python/wx2.8.pth
/var/lib/dpkg/alternatives/wx2.4.pth
/var/lib/dpkg/alternatives/wx2.5.pth

In Jaunty:
>>> import sys
>>> sys.path
['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/Numeric', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/var/lib/python-support/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/var/lib/python-support/python2.6/gtk-2.0', '/usr/lib/python2.6/dist-packages/wx-2.6-gtk2-unicode', '/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode']

In Intrepid:
>>> import sys
>>> sys.path
['', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/PIL', '/usr/lib/python2.5/site-packages/gst-0.10', '/var/lib/python-support/python2.5', '/var/lib/python-support/python2.5/gtk-2.0', '/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode']

So in Jaunty both wx-2.6 and wx2.8 are added to the sys.path, while in Intrepid only wx-2.8 was present.
To me it seems like a bug that both wx 2.6 and 2.8 are in sys.path

See also this discussion on the wxpython users mailing list upstream: http://thread.gmane.org/gmane.comp.python.wxpython/70340

Some wxpython programs are now showing bugs as they are not compatible anymore with wxpython2.6

If possible, it would be nice that in Jaunty (like in intrepid) wxPython 2.8 is the default if both 2.6 and 2.8 are installed. For sure sudo update-alternatives should work for wxpython, so that at least the user can configure it the default wxpython version.

Stani (stani)
summary: - since Jaunty python-wxgtk2.6 should not take priority by default over
- python-wxgtk2.8
+ not possible to switch between python-wxgtk2.6 or python-wxgtk2.8 as the
+ default wxPython in Jaunty
Stani (stani)
description: updated
summary: - not possible to switch between python-wxgtk2.6 or python-wxgtk2.8 as the
- default wxPython in Jaunty
+ sudo update-alternatives does not configure the default python-wxgtk in
+ Jaunty
Morten Kjeldgaard (mok0)
Changed in wxwidgets2.8 (Ubuntu):
status: New → Confirmed
Morten Kjeldgaard (mok0)
Changed in wxwidgets2.8 (Ubuntu):
assignee: nobody → Morten Kjeldgaard (mok0)
Revision history for this message
Stani (stani) wrote :

The problem seems to be that wx-2.6-gtk2-unicode.pth and wx-2.8-gtk2-unicode.pth are present in /usr/lib/python2.*/dist-packages. Removing these two symlinks solves the issue. Probably this needs to be fixed in python-wxgtk.postinst

Changed in wxwidgets2.8 (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Morten Kjeldgaard (mok0) wrote :

You are right, except the place to fix it is not in python-wxgtk.postinst, which merely establishes (correctly) the alternatives system.

Unfortunately, I'm currently getting an FTBFS for wxwidgets-2.8 on both my jaunty and karmic sbuilders.

Revision history for this message
aslam karachiwala (akwala) wrote :

What's the latest on this bug? I ran into this version confusion when trying to launch Editra (on Ubuntu 9.10 amd64):

# VersionError: Editra requires wxPython 2.8.3 or higher
              Your version is 2.6.3.2

The relevant alternatives are set thus...

$ ls -l /etc/alternatives/wx*
lrwxrwxrwx 1 root root 28 2009-12-15 01:02 /etc/alternatives/wx2.5.pth -> /usr/lib/wx/python/wx2.8.pth
lrwxrwxrwx 1 root root 28 2009-12-15 01:02 /etc/alternatives/wx2.6.pth -> /usr/lib/wx/python/wx2.8.pth

...however, sys.path shows both versions of wxPython, 2.6 followed by 2.8:

>>> import sys
>>> sys.path
['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.6/gtk-2.0', '/usr/lib/python2.6/dist-packages/wx-2.6-gtk2-unicode', '/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode', '/usr/local/lib/python2.6/dist-packages']

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wxwidgets2.6 - 2.6.3.2.2-3ubuntu6

---------------
wxwidgets2.6 (2.6.3.2.2-3ubuntu6) maverick; urgency=low

  * Remove files which broke update-alternatives (LP: #379573).
 -- Devid Antonio Filoni <email address hidden> Tue, 20 Jul 2010 06:28:18 +0200

Changed in wxwidgets2.6 (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wxwidgets2.8 - 2.8.11.0-0ubuntu2

---------------
wxwidgets2.8 (2.8.11.0-0ubuntu2) maverick; urgency=low

  * Merge *some* changes from Debian package (version 2.8.10.1-3). This should
    make merges easier. Also fixes LP: #559822. Also merged several patches.
  * Remove debian/patches/editra_pixmaps.dpatch patch, we don't ship editra
    anymore.
  * Remove files which broke update-alternatives (LP: #379573).
  * Switch to format 3.0 (quilt).
 -- Devid Antonio Filoni <email address hidden> Tue, 20 Jul 2010 01:55:41 +0200

Changed in wxwidgets2.8 (Ubuntu):
status: In Progress → Fix Released
Changed in wxwidgets2.6 (Ubuntu Lucid):
assignee: nobody → Devid Antonio Filoni (d.filoni)
status: New → In Progress
Changed in wxwidgets2.8 (Ubuntu Lucid):
assignee: nobody → Devid Antonio Filoni (d.filoni)
status: New → In Progress
Revision history for this message
Devid Antonio Filoni (d.filoni) wrote :

ubuntu-sru ACK for wxwidgets2.8 and wxwidgets2.6 uploaded packages.

Changed in wxwidgets2.6 (Ubuntu Lucid):
assignee: Devid Antonio Filoni (d.filoni) → nobody
status: In Progress → Confirmed
Changed in wxwidgets2.8 (Ubuntu Lucid):
assignee: Devid Antonio Filoni (d.filoni) → nobody
status: In Progress → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted wxwidgets2.8 into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in wxwidgets2.8 (Ubuntu Lucid):
status: Confirmed → Fix Committed
tags: added: verification-needed
Changed in wxwidgets2.6 (Ubuntu Lucid):
status: Confirmed → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted wxwidgets2.6 into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in wxwidgets2.8 (Ubuntu):
assignee: Morten Kjeldgaard (mok0) → nobody
Revision history for this message
Graham Lamont (graham-lamont) wrote :

Sorry to barge into the middle of this fix. But does anyone know whether this bug is related to this:

In jaunty, having
1 installed wxgtk2.6
2 installed wxgtk2.8
3 completely uninstalled both
4 installed wxgtk2.8

*Still* get:
   File "Grid.py", line 2, in <module>
    import wx
ImportError: No module named wx

with
sys.path=['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/var/lib/python-support/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/var/lib/python-support/python2.6/gtk-2.0', '/usr/local/lib/python2.6/dist-packages']

ie. no sign of /usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode.

When I insert:
import sys
sys.path=['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/var/lib/python-support/python2.6', '/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode', '/var/lib/python-support/python2.6/gtk-2.0', '/usr/local/lib/python2.6/dist-packages']

at start of Grid.py (demo) appears to work.

But unfortunately I'm so thick I wouldn't know what to do other than prepend this to all files!

Is this thread likely to ultimately provide a solution to my n00b woes ?
Thanks.

Revision history for this message
Thierry Carrez (ttx) wrote :

Apparently the wxwidgets2.8 package in -proposed breaks pgadmin3, until a no-op rebuild is done on it. See bug 610975.

Revision history for this message
Devid Antonio Filoni (d.filoni) wrote :

This bug looks to be fixed in lucid-proposed too but I have to prepare a new version of wxwidgets2.8 package due to bug #559822.

root@dfiloni-desktop:/# update-alternatives --config wx2.6.pth
There are 2 choices for the alternative wx2.6.pth (providing /usr/lib/python2.6/dist-packages/wx.pth).

  Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/wx/python/wx2.8.pth 28 auto mode
  1 /usr/lib/wx/python/wx2.6.pth 26 manual mode
  2 /usr/lib/wx/python/wx2.8.pth 28 manual mode

Press enter to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/lib/wx/python/wx2.6.pth to provide /usr/lib/python2.6/dist-packages/wx.pth (wx2.6.pth) in manual mode.
root@dfiloni-desktop:/# python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> wx.VERSION
(2, 6, 3, 2, '')
>>> exit ()
root@dfiloni-desktop:/# update-alternatives --config wx2.6.pth
There are 2 choices for the alternative wx2.6.pth (providing /usr/lib/python2.6/dist-packages/wx.pth).

  Selection Path Priority Status
------------------------------------------------------------
  0 /usr/lib/wx/python/wx2.8.pth 28 auto mode
* 1 /usr/lib/wx/python/wx2.6.pth 26 manual mode
  2 /usr/lib/wx/python/wx2.8.pth 28 manual mode

Press enter to keep the current choice[*], or type selection number: 0
update-alternatives: using /usr/lib/wx/python/wx2.8.pth to provide /usr/lib/python2.6/dist-packages/wx.pth (wx2.6.pth) in auto mode.
root@dfiloni-desktop:/# python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> wx.VERSION
(2, 8, 10, 1, '')
>>> exit ()
root@dfiloni-desktop:/#

Revision history for this message
Jonathan Riddell (jr) wrote :

unsubscribing ubuntu-archive, dunno why we are subscribed

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I confirm that the version 2.8.10.1-0ubuntu1.2 of python-wxgtk2.8 in -proposed fixes the issue reported here but introduce the regression noted by Thierry.
Marking as verification-failed.

Changed in wxwidgets2.8 (Ubuntu Lucid):
status: Fix Committed → In Progress
tags: added: regression-proposed verification-failed
removed: verification-needed
Revision history for this message
Devid Antonio Filoni (d.filoni) wrote :

Fix works fine. In order to fix that regression we have to rebuild pgadmin3 package, that cannot be fixed in wxwidgets2.8.

Changed in wxwidgets2.8 (Ubuntu Lucid):
status: In Progress → Fix Committed
tags: added: verification-done
removed: regression-proposed verification-failed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Devid, I agree the fix works fine. But because the newer wxwidget2.8 introduces a regression for a least 3 packages making them unusable we cannot published it to -updates until the relocation error is fixed too. Per SRU policy (https://wiki.ubuntu.com/StableReleaseUpdates) I'm marking this report as 'verification-failed'

tags: added: verification-failed
removed: verification-done
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

too late. This just has been pushed to -updates :(

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 379573] Re: sudo update-alternatives does not configure the default python-wxgtk in Jaunty

There is a defined process for regressions in -updates. My recommendation would be for one of you that have been following the issue to use it.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

That's okay, the relocation issue is tracked in bug 610975 and the packages will be available in -proposed in a few hours.

Changed in wxwidgets2.8 (Ubuntu Lucid):
status: Fix Committed → Fix Released
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

SRU verification for Lucid:
I have reproduced the problem with wxwidgets2.6 2.6.3.2.2-3ubuntu5 in lucid and have verified that the version of wxwidgets2.6 2.6.3.2.2-3ubuntu5.1 in -proposed fixes the issue.

Marking as verification-done

tags: added: verification-done
removed: verification-failed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wxwidgets2.6 - 2.6.3.2.2-3ubuntu5.1

---------------
wxwidgets2.6 (2.6.3.2.2-3ubuntu5.1) lucid-proposed; urgency=low

  * python-wxgtk2.6: remove files which broke update-alternatives
    (LP: #379573).
 -- Devid Antonio Filoni <email address hidden> Tue, 20 Jul 2010 20:02:44 +0200

Changed in wxwidgets2.6 (Ubuntu Lucid):
status: Fix Committed → Fix Released
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.