error with embedding_in_wx.py

I get the error even using 0.51. Maybe my wxPython is

    > broken. Do you know of a way I can test it?

The example runs fine on my systm.

Something funny is going on. wx does not attempt to load mathtext,
either in 0.51 or in CVS. That, and the fact that you are getting a
gthread error, make me suspect you are actually loading the gtk
backend.

Are you trying to run embedding_in_wx from the prompt or from a
development environment such as pycrust? If you run from the prompt,
you shouldn't see that error. If not, you may be loading the default
backend (GTK) first in your development environment and then trying to
run embedding_in_wx.

For example, if you first import matplotlib and later try to run
embedding_in_wx in the same python/pycrust session, you will get
yourself into a world of trouble, since the default import loads GTK
and the second one WX. These two cannot peacefully coexist.

Try running the examples from the linux shell or DOS prompt first.
Have you read the information about how to select the various backends
on http://matplotlib.sourceforge.net/backends.html?

You can change your default backend (eg to WX) in you .matplotlibrc
file.

  http://matplotlib.sourceforge.net/faq.html#MATPLOTLIBRC
  http://matplotlib.sourceforge.net/.matplotlibrc

If you still encounter problems, please tell me exactly what you are
doing: what platform, how you are trying to run the example etc...

Hope this helps,
JDH

I have been running from the prompt all along. The command line is:

wohlbier@...111... examples $ python embedding_in_wx.py
Could not import mathtext (build with ft2font)

GThread-ERROR **: GThread system may only be initialized once.
aborting...
Aborted
wohlbier@...111... examples $

If running from the command line, does .matplotlibrc make a difference?
I did set the default backend in this file to WX.

I am on gentoo linux, python 2.3.3, wxPython 2.4.1.2, matplotlib 0.51,
executing from the command line as above, from the directory
/usr/lib/python2.3/site-packages/matplotlib-0.51/examples/

Let me know if you need something more about my setup.

jgw

···

    > I get the error even using 0.51. Maybe my wxPython is
    > broken. Do you know of a way I can test it?

The example runs fine on my systm.

Something funny is going on. wx does not attempt to load mathtext,
either in 0.51 or in CVS. That, and the fact that you are getting a
gthread error, make me suspect you are actually loading the gtk
backend.

Are you trying to run embedding_in_wx from the prompt or from a
development environment such as pycrust? If you run from the prompt,
you shouldn't see that error. If not, you may be loading the default
backend (GTK) first in your development environment and then trying to
run embedding_in_wx.

For example, if you first import matplotlib and later try to run
embedding_in_wx in the same python/pycrust session, you will get
yourself into a world of trouble, since the default import loads GTK and
the second one WX. These two cannot peacefully coexist.

Try running the examples from the linux shell or DOS prompt first. Have
you read the information about how to select the various backends on
http://matplotlib.sourceforge.net/backends.html?

You can change your default backend (eg to WX) in you .matplotlibrc
file.

  http://matplotlib.sourceforge.net/faq.html#MATPLOTLIBRC
  http://matplotlib.sourceforge.net/.matplotlibrc

If you still encounter problems, please tell me exactly what you are
doing: what platform, how you are trying to run the example etc...

Hope this helps,
JDH

Another clue, when I try another example with wx I get:

wohlbier@...111... examples $ python dynamic_demo_wx.py
Traceback (most recent call last):
  File "dynamic_demo_wx.py", line 34, in ?
    from matplotlib.backends import Figure, Toolbar, FigureManager
ImportError: cannot import name Figure
wohlbier@...111... examples $

Does this mean anything?

jgw

···

    > I get the error even using 0.51. Maybe my wxPython is
    > broken. Do you know of a way I can test it?

The example runs fine on my systm.

Something funny is going on. wx does not attempt to load mathtext,
either in 0.51 or in CVS. That, and the fact that you are getting a
gthread error, make me suspect you are actually loading the gtk
backend.

Are you trying to run embedding_in_wx from the prompt or from a
development environment such as pycrust? If you run from the prompt,
you shouldn't see that error. If not, you may be loading the default
backend (GTK) first in your development environment and then trying to
run embedding_in_wx.

For example, if you first import matplotlib and later try to run
embedding_in_wx in the same python/pycrust session, you will get
yourself into a world of trouble, since the default import loads GTK and
the second one WX. These two cannot peacefully coexist.

Try running the examples from the linux shell or DOS prompt first. Have
you read the information about how to select the various backends on
http://matplotlib.sourceforge.net/backends.html?

You can change your default backend (eg to WX) in you .matplotlibrc
file.

  http://matplotlib.sourceforge.net/faq.html#MATPLOTLIBRC
  http://matplotlib.sourceforge.net/.matplotlibrc

If you still encounter problems, please tell me exactly what you are
doing: what platform, how you are trying to run the example etc...

Hope this helps,
JDH