OK, but right now MPL is broken with my version of wxversion, which is the
one shipped by default in Ubuntu. So it is broken for a lot of user.
Are you sure? Could you be pulling in some other wxversion? The only
other person reporting this problem so far is Tony Yu. I am now on
jaunty, and my wxversion has AlreadyImportedError. What version of
ubuntu are you using, and what is the full wx version that it includes?
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
Type "copyright", "credits" or "license" for more information.
IPython 0.10.bzr.r1163 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In : import wxversion
In : wxversion.__file__
So, if wx2.6 is installed (I have 2.8 installed too), we run into these
Also, it is interesting to see that the older wxversion gets imported.
That does defeat the purpose of wxversion :). It means that you can't
have multiple versions of wx installed.
It seems wrong for me to require the users to upgrade wxversion while
there is a solution that works, eventhough it may not be exactly what you
The solution you propose doesn't work. It completely defeats the
In a way it does. So we can add a check:
"if 'wx' in sys.module:"
to replace the "AlreadyImportedError", it is clearly bug ware.
One solution is to do bugware with hasattr(wxversion, 'AlreadyImportedError')
Committed to svn. Please check it.
Certainly does work betters. Also, the "AlreadyImported" problem is
caught elsewhere if I preimport an older version of wx:
File "/home/varoquau/dev/matplotlib/lib/pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "/home/varoquau/dev/matplotlib/lib/matplotlib/pylab.py", line 244,
from matplotlib.pyplot import *
File "/home/varoquau/dev/matplotlib/lib/matplotlib/pyplot.py", line 76,
new_figure_manager, draw_if_interactive, show = pylab_setup()
25, in pylab_setup
line 23, in <module>
import backend_wx # already uses wxversion.ensureMinimal('2.8')
line 137, in <module>
ImportError: Matplotlib backend_wx and backend_wxagg require wxPython >=2.8
Thanks for your fix.
On Fri, Jul 10, 2009 at 09:41:30AM -1000, Eric Firing wrote: