Matplotlib says it needs libpng15, but I have libpng16

The problem is most likely related to the configuration, because a proper installation on a Mac seems like a daunting task. I run Mavericks and matplotlib 1.4.x, but when I open the Python 2.7.5 shell and import pylib , I get this error:

 >>> import pylab Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/pylab.py", line 1, in <module> from matplotlib.pylab import * File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/pylab.py", line 230, in <module> import matplotlib.finance File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/finance.py", line 38, in <module> from matplotlib.collections import LineCollection, PolyCollection File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/collections.py", line 27, in <module> import matplotlib.backend_bases as backend_bases File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/backend_bases.py", line 55, in <module> import matplotlib.textpath as textpath File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/textpath.py", line 22, in <module> from matplotlib.mathtext import MathTextParser File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/mathtext.py", line 64, in <module> import matplotlib._png as _png ImportError: dlopen(/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/_png.so, 2): Library not loaded: /usr/local/lib/libpng15.15.dylib Referenced from: /Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/_png.so Reason: image not found 

I have libpng16 installed, but not libpng15 .

+6
source share
2 answers

I saw a hard link to libpng15 in _png.so.
Uninstalling and installing matplotlib fixed the problem for me.

+4
source

You can always say it by creating such a soft link.

 sudo ln -s /opt/X11/lib/libpng.dylib /usr/local/lib/libpng15.15.dylib 

Not a clean solution, but I donโ€™t understand why matplotlib stubbornly asks specifically about libpng15 and not about 15 or more.

+2
source

All Articles