I am trying to install matplotlib library for Python. The installation was OK but I got the following error when I imported pylab (e.g. import pylab as p) in Python.
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mathtext.py", line 61, in <module>
import matplotlib._png as _png
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so, 2): Symbol not found: _png_set_longjmp_fn
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
Expected in: flat namespace in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
Google searches indicate that the link error (which does not look for "_png_set_longjmp_fn" ) is related to a 32/64 bit compiling issue for the png library.
I tried to re-install matplotlib based on README.osx file in the library but it was not fixed. Other methods that I found did not resolve it. Also, I checked out if the libraries are compiled at 32 or 64 bit. The relevant binaries support both ( universal binaries) as follows.
>file /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so: Mach-O universal binary with 2 architectures
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so (for architecture i386): Mach-O bundle i386
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so (for architecture x86_64): Mach-O 64-bit bundle x86_64
>file /Library/Frameworks/libpng.framework/Versions/Current/libpng
/Library/Frameworks/libpng.framework/Versions/Current/libpng: Mach-O universal binary with 2 architectures
/Library/Frameworks/libpng.framework/Versions/Current/libpng (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
/Library/Frameworks/libpng.framework/Versions/Current/libpng (for architecture i386): Mach-O dynamically linked shared library i386
My OS X version is Lion 10.7.4. Do you have any idea on this problem? Thanks!!!