matplotlib._png failure on 64-bit OSX

I have built matplotlib from svn on OSX 10.6, using the make.osx script that is included with the source, except with the 32-bit build flags removed. The resulting module fails on import, however, with the following:

In [1]: from pylab import *

···

------------------------------------------------------------
Traceback (most recent call last):
File "<ipython console>", line 1, in <module>
File "/Library/Python/2.6/site-packages/matplotlib-1.0.svn_r8034-py2.6-macosx-10.6-universal.egg/pylab.py", line 1, in <module>
   from matplotlib.pylab import *
File "/Library/Python/2.6/site-packages/matplotlib-1.0.svn_r8034-py2.6-macosx-10.6-universal.egg/matplotlib/pylab.py", line 206, in <module>
   from matplotlib import mpl # pulls in most modules
File "/Library/Python/2.6/site-packages/matplotlib-1.0.svn_r8034-py2.6-macosx-10.6-universal.egg/matplotlib/mpl.py", line 2, in <module>
   from matplotlib import axis
File "/Library/Python/2.6/site-packages/matplotlib-1.0.svn_r8034-py2.6-macosx-10.6-universal.egg/matplotlib/axis.py", line 14, in <module>
   import matplotlib.text as mtext
File "/Library/Python/2.6/site-packages/matplotlib-1.0.svn_r8034-py2.6-macosx-10.6-universal.egg/matplotlib/text.py", line 30, in <module>
   from matplotlib.backend_bases import RendererBase
File "/Library/Python/2.6/site-packages/matplotlib-1.0.svn_r8034-py2.6-macosx-10.6-universal.egg/matplotlib/backend_bases.py", line 40, in <module>
   import matplotlib.textpath as textpath
File "/Library/Python/2.6/site-packages/matplotlib-1.0.svn_r8034-py2.6-macosx-10.6-universal.egg/matplotlib/textpath.py", line 9, in <module>
   from matplotlib.mathtext import MathTextParser
File "/Library/Python/2.6/site-packages/matplotlib-1.0.svn_r8034-py2.6-macosx-10.6-universal.egg/matplotlib/mathtext.py", line 52, in <module>
   import matplotlib._png as _png
ImportError: dlopen(/Library/Python/2.6/site-packages/matplotlib-1.0.svn_r8034-py2.6-macosx-10.6-universal.egg/matplotlib/_png.so, 2): Symbol not found: _png_create_info_struct
Referenced from: /Library/Python/2.6/site-packages/matplotlib-1.0.svn_r8034-py2.6-macosx-10.6-universal.egg/matplotlib/_png.so
Expected in: flat namespace
in /Library/Python/2.6/site-packages/matplotlib-1.0.svn_r8034-py2.6-macosx-10.6-universal.egg/matplotlib/_png.so

This seems like this is related to 32-bit code lurking somewhere, but I'm not sure where. I am surely using 64-bit python.

Any ideas or solutions are appreciated.

I was able to get a build that imports without error, but on several plots I get the very bizarre error:

  File "/Library/Python/2.6/site-packages/matplotlib-1.0.svn_r8035-py2.6-macosx-10.6-universal.egg/matplotlib/backends/backend_agg.py", line 221, in _get_agg_font
    font = FT2Font(str(fname))
RuntimeError: Could not open facefile /Library/Python/2.6/site-packages/matplotlib-1.0.svn_r7956-py2.6-macosx-10.6-universal.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf; Cannot_Open_Resource

Notice that the current matplotlib .egg package (r8035) looks for resources in a previous build (r7956)! I have eradicated all previous matplotlib builds and deleted the build folder from within the matplotlib source folder. I have no idea why this is happening.

···

On 16/12/2009, at 7:47 PM, Christopher Fonnesbeck wrote:

I have built matplotlib from svn on OSX 10.6, using the make.osx script that is included with the source, except with the 32-bit build flags removed. The resulting module fails on import, however, with the following: