plt.figure() causes crash on OS X 10.5.7, Py26 binaries

Using the binaries at matplotlib.sf.net:

dwf@...768...:~$ ipython -pylab
Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39)
Type "copyright", "credits" or "license" for more information.

IPython 0.10 -- 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.

   Welcome to pylab, a matplotlib-based Python environment.
   For more information, type 'help(pylab)'.

In [1]: matplotlib.__version__Out[1]: '0.99.0'

In [2]: matplotlib.get_backend()
Out[2]: 'TkAgg'

In [3]: plt.figure()
Bus error

GDB says this was the problem:

>>> fig = plt.figure()

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000028
0x00e04d95 in PyArray_INCREF ()

I wonder if this is caused by me having my own freetype installed under /usr/local (I was installing Chaco the other day from source, and thus required it), and the dynamic linker getting confused about which version to use?

David

Could you try the 99.1rc release candidate linked to in the "news" box on the mpl homepage? I did fix some link problems in the osx binaries since 0.99.0.

···

On Sep 18, 2009, at 4:53 PM, David Warde-Farley <dwf@...756...> wrote:

Using the binaries at matplotlib.sf.net:

dwf@...768...:~$ ipython -pylab
Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39)
Type "copyright", "credits" or "license" for more information.

IPython 0.10 -- 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.

  Welcome to pylab, a matplotlib-based Python environment.
  For more information, type 'help(pylab)'.

In [1]: matplotlib.__version__Out[1]: '0.99.0'

In [2]: matplotlib.get_backend()
Out[2]: 'TkAgg'

In [3]: plt.figure()
Bus error

GDB says this was the problem:

fig = plt.figure()

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000028
0x00e04d95 in PyArray_INCREF ()

I wonder if this is caused by me having my own freetype installed
under /usr/local (I was installing Chaco the other day from source,
and thus required it), and the dynamic linker getting confused about
which version to use?

David

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Just tried, unfortunately it doesn't seem to like my setup either:

RuntimeError: FATAL: module compiled aslittle endian, but detected different endianness at runtime
Traceback (most recent call last):
   File "/Library/Frameworks/Python.framework/Versions/2.6/bin/ipython", line 8, in <module>
     load_entry_point('ipython==0.10', 'console_scripts', 'ipython')()
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.10-py2.6.egg/IPython/ipapi.py", line 556, in launch_new_instance
     ses = make_session(user_ns,shellclass)
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.10-py2.6.egg/IPython/ipapi.py", line 684, in make_session
     return IPython.Shell.start(user_ns)
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.10-py2.6.egg/IPython/Shell.py", line 1241, in start
     return shell(user_ns = user_ns)
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.10-py2.6.egg/IPython/Shell.py", line 1106, in __init__
     shell_class=MatplotlibShell)
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.10-py2.6.egg/IPython/Shell.py", line 73, in __init__
     debug=debug,shell_class=shell_class)
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.10-py2.6.egg/IPython/ipmaker.py", line 100, in make_IPython
     embedded=embedded,**kw)
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.10-py2.6.egg/IPython/Shell.py", line 627, in __init__
     user_ns,user_global_ns,b2 = self._matplotlib_config(name,user_ns,user_global_ns)
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.10-py2.6.egg/IPython/Shell.py", line 556, in _matplotlib_config
     import matplotlib.pylab as pylab
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/pylab.py", line 206, in <module>
     from matplotlib import mpl # pulls in most modules
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/mpl.py", line 1, in <module>
     from matplotlib import artist
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/artist.py", line 5, in <module>
     from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/transforms.py", line 34, in <module>
     from matplotlib._path import affine_transform
ImportError: numpy.core.multiarray failed to import

···

On 18-Sep-09, at 6:09 PM, John Hunter wrote:

Could you try the 99.1rc release candidate linked to in the "news" box on the mpl homepage? I did fix some link problems in the osx binaries since 0.99.0.

Looking a little harder at this (after downloading the source) I'm positively at a loss, since multiarray doesn't seem to be explicitly imported anywhere in matplotlib. Furthermore, importing numpy.core.multiarray from ipython works just fine.

Moreover, I just built matplotlib-0.99.1rc1 from source and the problem doesn't manifest. _Weird_. Any idea what's going on?

David

···

On 18-Sep-09, at 6:42 PM, David Warde-Farley wrote:

  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/ipython-0.10-py2.6.egg/IPython/Shell.py", line
627, in __init__
    user_ns,user_global_ns,b2 =
self._matplotlib_config(name,user_ns,user_global_ns)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/ipython-0.10-py2.6.egg/IPython/Shell.py", line
556, in _matplotlib_config
    import matplotlib.pylab as pylab
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/pylab.py", line 206, in <module>
    from matplotlib import mpl # pulls in most modules
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/mpl.py", line 1, in <module>
    from matplotlib import artist
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/artist.py", line 5, in <module>
    from transforms import Bbox, IdentityTransform, TransformedBbox,
TransformedPath
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/transforms.py", line 34, in <module>
    from matplotlib._path import affine_transform
ImportError: numpy.core.multiarray failed to import

David Warde-Farley wrote:

···

On 18-Sep-09, at 6:42 PM, David Warde-Farley wrote:
  

  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/ipython-0.10-py2.6.egg/IPython/Shell.py", line
627, in __init__
    user_ns,user_global_ns,b2 =
self._matplotlib_config(name,user_ns,user_global_ns)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/ipython-0.10-py2.6.egg/IPython/Shell.py", line
556, in _matplotlib_config
    import matplotlib.pylab as pylab
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/pylab.py", line 206, in <module>
    from matplotlib import mpl # pulls in most modules
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/mpl.py", line 1, in <module>
    from matplotlib import artist
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/artist.py", line 5, in <module>
    from transforms import Bbox, IdentityTransform, TransformedBbox,
TransformedPath
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/transforms.py", line 34, in
<module>
    from matplotlib._path import affine_transform
ImportError: numpy.core.multiarray failed to import
    
Looking a little harder at this (after downloading the source) I'm
positively at a loss, since multiarray doesn't seem to be explicitly
imported anywhere in matplotlib. Furthermore, importing
numpy.core.multiarray from ipython works just fine.

Moreover, I just built matplotlib-0.99.1rc1 from source and the
problem doesn't manifest. _Weird_. Any idea what's going on?
  

Maybe the MPL binary was built with a numpy svn version that had API
incompatibilities with numpy releases?

I built the python2.6 OSX 0.99.1rc1 binary with the numpy from the
1.3.0 dmg installer from the sf site, intentionally not using my local
numpy from svn since I understand there are some ABI incompatibilities
between 1.3.0 and 1.4.0svn and I wanted to target the latest release.
What version are you using David?

JDH

···

On Fri, Sep 18, 2009 at 7:01 PM, Andrew Straw <strawman@...36...> wrote:

Maybe the MPL binary was built with a numpy svn version that had API
incompatibilities with numpy releases?

(reply-all this time, I'm too used to scipy.org's reply-to munging)

···

On 18-Sep-09, at 9:36 PM, John Hunter wrote:

On Fri, Sep 18, 2009 at 7:01 PM, Andrew Straw <strawman@...36...> > wrote:

Maybe the MPL binary was built with a numpy svn version that had API
incompatibilities with numpy releases?

I built the python2.6 OSX 0.99.1rc1 binary with the numpy from the
1.3.0 dmg installer from the sf site, intentionally not using my local
numpy from svn since I understand there are some ABI incompatibilities
between 1.3.0 and 1.4.0svn and I wanted to target the latest release.
What version are you using David?

Sorry for leaving this thread dangling. I was using the latest numpy SVN head, that was probably the issue. I've since built matplotlib from source without incident.

David