cannot use python-wxgtk2.8 after uninstalling python-wxgtk2.6

Bug #948944 reported by sanktnelson
54
This bug affects 9 people
Affects Status Importance Assigned to Milestone
wxwidgets2.8 (Ubuntu)
Triaged
High
Unassigned
Nominated for Trusty by Rolf Leggewie

Bug Description

I am using the printrun utilities from ppa:richi-paraeasy/ppa. Upon upgrade from oneiric pronterface, which uses and depends on wxpython 2.8, fails to run due to missing attributes even though both wxpython 2.6 and 2.8 are both installed. It turns out that it is actually using 2.6, since removing 2.6 results in the error changing to "import wx: no such module". This seems related to python-wxversion since removing and reinstalling python-wxgtk2.6 and 2.8 did not help. What helped was removing both as well as python-wxversion, and then reinstalling only 2.8 and wxversion. Presumably other packages and third party applications using wxpython will run into similar problems.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: python-wxversion 2.8.12.1-6ubuntu2
ProcVersionSignature: Ubuntu 3.2.0-18.28-generic-pae 3.2.9
Uname: Linux 3.2.0-18-generic-pae i686
NonfreeKernelModules: nvidia
ApportVersion: 1.94-0ubuntu2
Architecture: i386
Date: Wed Mar 7 14:05:51 2012
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=de_DE:de:en_GB:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: wxwidgets2.8
UpgradeStatus: Upgraded to precise on 2012-03-05 (1 days ago)

Revision history for this message
sanktnelson (launchpad-maibaums) wrote :
Revision history for this message
Scott Kitterman (kitterman) wrote :

From a clean oneiric chroot:

# apt-get install python-wxgtk2.6 python-wxgtk2.8
...
# python
...
>>> import wx
>>> import sys
>>> print sys.modules
...'wx': <module 'wx' from '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/__init__.pyc'>...
Adjust /etc/apt/sources.list to precise and dist-upgrade.
...
# python
...
>>> import wx
>>> import sys
>>> print sys.modules
...'wx': <module 'wx' from '/usr/lib/python2.7/dist-packages/wx-2.6-gtk2-unicode/wx/__init__.pyc'>...

Definitely a bug and not related to the fact that there's a PPA package involved. I don't intend to work on fixing this, so fair game for anyone that's interested.

Changed in wxwidgets2.8 (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-12.04-beta-2
status: New → Triaged
Martin Pitt (pitti)
Changed in wxwidgets2.8 (Ubuntu):
milestone: ubuntu-12.04-beta-2 → ubuntu-12.04
Revision history for this message
Alex Mauer (hawke) wrote :

I ran into this problem when trying to build gnuradio from git, having had python-wxgtk2.6 installed previously.

Revision history for this message
Éric Piel (pieleric) wrote :

I noticed the same problem and removed python-wxgtk2.6 hoping it'd fix it, but then python cannot find any "wx" module at all!

Apparently it's a problem with the alternatives: python-wxgtk2.6 provides wx2.7.pth (where 2.7 stands for the _python_ version) and python-wxgtk2.8 provides wx.pth (no version here at all). So with python-wxgtk2.6 and python-wxgtk2.8 installed you get this:

$ head /var/lib/dpkg/alternatives/wx*
==> /var/lib/dpkg/alternatives/wx2.7.pth <==
auto
/usr/lib/python2.7/dist-packages/wx.pth

/usr/lib/wx/python/wx2.6.pth
26

==> /var/lib/dpkg/alternatives/wx.pth <==
auto
/usr/lib/wx/python/wx.pth

/usr/lib/wx/python/wx2.8.pth
28

============================

/usr/lib/python2.7/dist-packages/ is actually the place where python look for the modules. So python-wxgtk2.8 gets kicked out by python-wxgtk2.6 .

There is obviously something wrong, as the 2 packages should provide alternatives to the same thing. Maybe making python-wxgtk2.8 an alternative for wx2.7.pth (/usr/lib/python2.7/dist-packages/wx.pth) instead of wx.pth is the most compatible way?

Note, as a workaround here is how I get python-wxgtk2.8 seen by python:
sudo apt-get remove python-wxgtk2.6
sudo ln -s /usr/lib/wx/python/wx.pth /usr/lib/python2.7/dist-packages/wx.pth

Revision history for this message
uellue (dieter-uellue) wrote :

I could reproduce the missing menu bar with this example code:

http://wiki.wxpython.org/Getting%20Started#Adding_a_menu_bar

Expected behavior: The menu bar is shown.
Actual behavior: There is no menu bar.

Revision history for this message
C Filorux (breakfast) wrote :
Revision history for this message
C Filorux (breakfast) wrote :

I have this behaviour on "12.10, Quantal Quetzal" using python-wxgtk2.8 under XFCE4. When I run the command as another user via a rather complex sudo script that grants permission to use the X display, the menu DOES display. (Sorry about the bare post containing the run-as-another-user hack - the comment system is not working so well for me).

Revision history for this message
Rolf Leggewie (r0lf) wrote :

I ran into the same issue and was able to fix it with "sudo aptitude reinstall python-wxgtk2.8 python-wxversion"

tags: added: trusty
summary: - after upgrade from oneiric python applications may use the wrong version
- of wxpython and fail as a result
+ cannot use python-wxgtk2.8 after uninstalling python-wxgtk2.6
Changed in wxwidgets2.8 (Ubuntu):
milestone: ubuntu-12.04 → ubuntu-14.04.1
Mathew Hodson (mhodson)
Changed in wxwidgets2.8 (Ubuntu):
milestone: ubuntu-14.04.1 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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