Can't use WXAgg

Having a problem with the WX backend; details follow.

I have wxPython 2.5 and matplotlib-0.60.2.win32-py2.3
installed.

My code snippet:
import matplotlib
matplotlib.use("WXAgg")
from matplotlib.matlab import *

Error msg:
Matplotlib backend_wx requires wxPython be installed

Code snippet from:
C:\Python23\Lib\site-packages\matplotlib\backends\backend_wx.py
try:
    from wxPython.wx import *
except:
    print >>sys.stderr, "Matplotlib backend_wx
requires wxPython be installed"
    sys.exit()

I receive the following traceback when I try to invoke
this from the command line:

Enthought Edition build 1057
Python 2.3.3 (#51, Feb 16 2004, 04:07:52) [MSC v.1200
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for
more information.

from wxPython.wx import *

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"C:\Python23\lib\site-packages\wxPython\__init__.py",
line 10, in ?
    import _wx
  File
"C:\Python23\Lib\site-packages\wxPython\_wx.py", line
3, in ?
    from core import *
  File
"C:\Python23\Lib\site-packages\wxPython\core.py", line
15, in ?
    import wx.core
  File "C:\Python23\lib\site-packages\wxPython\wx.py",
line 4, in ?
    from misc import *
  File
"C:\Python23\lib\site-packages\wxPython\misc.py", line
15, in ?
    import wx.misc
  File "C:\Python23\lib\site-packages\wxPython\wx.py",
line 6, in ?
    from misc2 import *
  File
"C:\Python23\lib\site-packages\wxPython\misc2.py",
line 4, in ?
    from windows import *
  File
"C:\Python23\lib\site-packages\wxPython\windows.py",
line 15, in ?
    import wx.windows
  File "C:\Python23\lib\site-packages\wxPython\wx.py",
line 10, in ?
    from gdi import *
  File
"C:\Python23\lib\site-packages\wxPython\gdi.py", line
15, in ?
    import wx.gdi
  File "C:\Python23\lib\site-packages\wxPython\wx.py",
line 12, in ?
    from fonts import *
  File
"C:\Python23\lib\site-packages\wxPython\fonts.py",
line 120, in ?
    class wxFontPtr(wxObjectPtr):
NameError: name 'wxObjectPtr' is not defined

code snippet from:
C:\Python23\Lib\site-packages\wxPython\fonts.py
class wxFontPtr(wxObjectPtr):

This doesn't seem to be a problem specific to
matplotlib. But, I'm wondering if anyone has
already solved this or I'm just missing something.

Thanks.
Barry Drake

Update to my previous post:

When I use the command line to use WXAgg, I receive
the following traceback:

import matplotlib
matplotlib.use("WXAgg")
from matplotlib.matlab import *

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"C:\Python23\Lib\site-packages\matplotlib\matlab.py",
line 144, in ?
    from backends import new_figure_manager,
error_msg, \
  File
"C:\Python23\Lib\site-packages\matplotlib\backends\__init__.py",
line 39, in ?
    from backend_wxagg import \
  File
"C:\Python23\Lib\site-packages\matplotlib\backends\backend_wxagg.py",
line 20, in ?
    from backend_wx import FigureManager
  File
"C:\Python23\Lib\site-packages\matplotlib\backends\backend_wx.py",
line 116, in ?
    wxapp = wxPySimpleApp()
NameError: name 'wxPySimpleApp' is not defined

This means that it gets past the try-except in
backend_wx.py, but can't find wxPySimpleApp.

In the previous post, when runing the code from a
file, the exception was caught and
a sysexit() occurred.

I don't understand why in one case the exception is
caught and not in the other.
In either case, I'm still unable to use the wx
backend.

Thanks.
Barry Drake

--- Barry Drake wrote:
&gt; Having a problem with the WX backend; details
&gt; follow.
&gt;
&gt; I have wxPython 2.5 and
&gt; matplotlib-0.60.2.win32-py2.3
&gt; installed.
&gt;
&gt; My code snippet:
&gt; import matplotlib
&gt; matplotlib.use("WXAgg")
&gt; from matplotlib.matlab import *
&gt;
&gt; Error msg:
&gt; Matplotlib backend_wx requires wxPython be
installed
&gt;
&gt; Code snippet from:
&gt;
C:\Python23\Lib\site-packages\matplotlib\backends\backend_wx.py
&gt; try:
&gt; from wxPython.wx import *
&gt; except:
&gt; print &gt;&gt;sys.stderr, "Matplotlib
backend_wx
&gt; requires wxPython be installed"
&gt; sys.exit()
&gt;
&gt; I receive the following traceback when I try to
&gt; invoke
&gt; this from the command line:
&gt;
&gt; Enthought Edition build 1057
&gt; Python 2.3.3 (#51, Feb 16 2004, 04:07:52) [MSC
&gt; v.1200
&gt; 32 bit (Intel)] on win32
&gt; Type "help", "copyright", "credits" or "license"
for
&gt; more information.
&gt; &gt;&gt;&gt; from wxPython.wx import *
&gt; Traceback (most recent call last):
&gt; File "&lt;stdin&gt;", line 1, in ?
&gt; File
&gt;
"C:\Python23\lib\site-packages\wxPython\__init__.py",
&gt; line 10, in ?
&gt; import _wx
&gt; File
&gt; "C:\Python23\Lib\site-packages\wxPython\_wx.py",
&gt; line
&gt; 3, in ?
&gt; from core import *
&gt; File
&gt; "C:\Python23\Lib\site-packages\wxPython\core.py",
&gt; line
&gt; 15, in ?
&gt; import wx.core
&gt; File
&gt; "C:\Python23\lib\site-packages\wxPython\wx.py",
&gt; line 4, in ?
&gt; from misc import *
&gt; File
&gt; "C:\Python23\lib\site-packages\wxPython\misc.py",
&gt; line
&gt; 15, in ?
&gt; import wx.misc
&gt; File
&gt; "C:\Python23\lib\site-packages\wxPython\wx.py",
&gt; line 6, in ?
&gt; from misc2 import *
&gt; File
&gt;
"C:\Python23\lib\site-packages\wxPython\misc2.py",
&gt; line 4, in ?
&gt; from windows import *
&gt; File
&gt;
"C:\Python23\lib\site-packages\wxPython\windows.py",
&gt; line 15, in ?
&gt; import wx.windows
&gt; File
&gt; "C:\Python23\lib\site-packages\wxPython\wx.py",
&gt; line 10, in ?
&gt; from gdi import *
&gt; File
&gt; "C:\Python23\lib\site-packages\wxPython\gdi.py",
&gt; line
&gt; 15, in ?
&gt; import wx.gdi
&gt; File
&gt; "C:\Python23\lib\site-packages\wxPython\wx.py",
&gt; line 12, in ?
&gt; from fonts import *
&gt; File
&gt;
"C:\Python23\lib\site-packages\wxPython\fonts.py",
&gt; line 120, in ?
&gt; class wxFontPtr(wxObjectPtr):
&gt; NameError: name 'wxObjectPtr' is not defined
&gt;
&gt; code snippet from:
&gt; C:\Python23\Lib\site-packages\wxPython\fonts.py
&gt; class wxFontPtr(wxObjectPtr):
&gt;
&gt; This doesn't seem to be a problem specific to
&gt; matplotlib. But, I'm wondering if anyone has
&gt; already solved this or I'm just missing
something.
&gt;
&gt; Thanks.
&gt; Barry Drake
&gt;
&gt;
&gt;
&gt;

···

-------------------------------------------------------
&gt; This SF.Net email is sponsored by OSTG. Have you
&gt; noticed the changes on
&gt; Linux.com, ITManagersJournal and NewsForge in the
&gt; past few weeks? Now,
&gt; one more big change to announce. We are now OSTG-
&gt; Open Source Technology
&gt; Group. Come see the changes on the new OSTG site.
&gt; www.ostg.com
&gt; _______________________________________________
&gt; Matplotlib-users mailing list
&gt; Matplotlib-users@lists.sourceforge.net
&gt;
https://lists.sourceforge.net/lists/listinfo/matplotlib-users