The first suggestion failed with the same error, while the same suggestion worked up through the last step (make installers) which fails with the same error.

I decided to try Tommy's suggestion of just figuring out how to compile libpng as a universal binary.  The way I did it was to run the configuration script as:

./configure --disable-dependency-tracking

and then to manually edit the Makefile.  To CPPFLAGS and LDFLAGS I added

-arch i386 -arch ppc

Running make and sudo make install successfully built a universal library for me.

After deleting my old MPL egg, I import matplotlib successfully and the version number is as expected (0.98.6svn).

However, when I try to import pyplot, I get the following exception traceback.  Any suggestions on how to fix this?

Thanks again!

In [4]: import matplotlib.pyplot as plt
ImportError                               Traceback (most recent call last)

/usr/local/lib/<ipython console> in <module>()

/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/matplotlib/ in <module>()
      4 from matplotlib import _pylab_helpers, interactive
      5 from matplotlib.cbook import dedent, silent_list, is_string_like, is_numlike
----> 6 from matplotlib.figure import Figure, figaspect
      7 from matplotlib.backend_bases import FigureCanvasBase
      8 from matplotlib.image import imread as _imread

/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/matplotlib/ in <module>()
     17 import artist
     18 from artist import Artist, allow_rasterization
---> 19 from axes import Axes, SubplotBase, subplot_class_factory
     20 from cbook import flatten, allequal, Stack, iterable, dedent
     21 import _image

/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/matplotlib/ in <module>()
     17 import matplotlib.dates as mdates
     18 import matplotlib.font_manager as font_manager
---> 19 import matplotlib.image as mimage
     20 import matplotlib.legend as mlegend
     21 import matplotlib.lines as mlines

/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/matplotlib/ in <module>()
     19 # For clarity, names from _image are given explicitly in this module:
     20 import matplotlib._image as _image
---> 21 import matplotlib._png as _png
     23 # For user convenience, the names from _image are also imported into

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/matplotlib/, 2): Symbol not found: _png_create_info_struct
  Referenced from: /Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/matplotlib/
  Expected in: /usr/local/lib/libpng12.0.dylib

On Wed, Jul 29, 2009 at 21:46, John Hunter <> wrote:
On Wed, Jul 29, 2009 at 4:34 PM, Uri Laserson<> wrote:
> Hi everyone,
> I am trying to build the latest svn trunk version of MPL on OS X 10.5.  I am
> getting the following error:


 make build_osx105
 python install --prefix=~/somewhere

If that doesn't work, try

 cd release/osx

read the readme there and follow the instructions.  This will build
mpl the way we do when making a release: fetch the dependencies (zlip,
png and freetype) and build them with the right flags, and then build
mpl explcitly linking to these libs.


Uri Laserson
PhD Candidate, Biomedical Engineering
Harvard Medical School (Genetics)
Massachusetts Institute of Technology (Mathematics)
phone +1 917 742 8019