Created attachment 358448 [details, diff] patch against setupext.py With dev-python/matplotlib-1.3.0 (and media-libs/libpng-1.6.3), I cannot save a png file. $ python >>> from matplotlib.pyplot import savefig >>> savefig('a.png') libpng warning: Application built with libpng-1.2.41 but running with 1.6.3 Traceback (most recent call last): File "<stdin>", line 1, in <module> ... RuntimeError: Could not create write struct >>> The strange "libpng-1.2.41" points png.h of host OSX from /usr/X11/include. The patch attached excludes /usr/X11 from setupext.py for libpng, and since it also makes a freetype header be lost, adds some workarounds for include path of freetype. Older versions of matplotlib should show similar symptom.
Please reopen if this problem still exists with version 1.4
1.4.3 seems fine. Thank you.