Any fix for wxAgg on Mac?

On Feb 25 Samuel Smith reported that WXAgg crashed on MacOS X using
matplotlib 0.87. I just built matplotlib 0.87.7 on Python 2.5 and am
still having the problem.

Christopher Barker suggested disabling acceleration:
import matplotlib.backends.backend_wxagg
matplotlib.backends.backend_wxagg._use_accelerator(False)

and that does work, but I was wondering if a fix was known? Google only
turned up the problem, not a solution.

Regards,

-- Russell

P.S. here are the gory details:

Configuration:
- PowerBook G4
- MacOS X 10.4.7
- Python 2.5 (from the python main site)
- wxPython 2.7.1.3 (from
<http://pythonmac.org/packages/py25-fat/index.html>)
- numpy 1.0, numarray 1.5.1 and Numeric 24.2 (all from source)
- matplotlib 0.87.7 (from source)

TkAgg works fine, but WXAgg fails (using numarray or numeric as numerix)
when I try to plot as follows:

from pylab import *
show()

Traceback (most recent call last):
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pac
kages/matplotlib/backends/backend_wx.py", line 1048, in _onPaint
    self.draw(repaint=False)
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pac
kages/matplotlib/backends/backend_wxagg.py", line 63, in draw
    self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None)
MemoryError: _wxagg.convert_agg_to_wx_bitmap(): could not create the
wx.Bitmap
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pac
kages/matplotlib/backends/backend_wx.py", line 1193, in show
    figwin.canvas.draw()
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pac
kages/matplotlib/backends/backend_wxagg.py", line 63, in draw
    self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None)
MemoryError: _wxagg.convert_agg_to_wx_bitmap(): could not create the
wx.Bitmap

Russell E Owen wrote:

Russell E. Owen wrote:

On Feb 25 Samuel Smith reported that WXAgg crashed on MacOS X using matplotlib 0.87. I just built matplotlib 0.87.7 on Python 2.5 and am still having the problem.
- matplotlib 0.87.7 (from source)

That may be the issue -- are you sure you compiled against the right wx? Apple delivered a version with OS-X 10.4, and it tends to get found when you compile. Search the archives here for how to get it to find the right one.

I used the wxPython binary installer from pythonmac.org. I assumed it included a statically linked wx library but perhaps it does not.

yes, it does (well, not exactly, but it does include it's own copies of the wx libs)

If not, then I have no idea what wx it's using; I don't remember installing one but I suppose I might have long ago.

However, the issue is not which wx wxPython is using, but which wx matplotlib was built against.

I'm not sure this is relevant, but while building matplotlib I got warnings about using the deprecated wxPython package instead of wx.

yup, that's it all right.

when mpl is building , it looks for a utility called wx-config, that tells it where to find the headers and libs it needs. The default wx-config on OS-X will point to the wrong wx, so you need to set a n environment variable or something pointing to the correct wx-config.

Sorry I don't have the specific details right now, but it should be in the archives, or poke through setup.py and associated files for more info. I think I put a helpful warning in there at some point.

good luck,

-Chris

  I

···

had assumed the matplotlib folks were just a bit behind on their use of wx, but maybe it is a clue as to what's wrong.

-- Russell

--
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...