title: import matplotlib.pyplot gives ImportError: dlopen(...) Library not loaded libpng15.15.dylib
body: <p>Importing pyplot gives an error: </p>
  
  <pre><code>In [1]: import matplotlib
  In [2]: import matplotlib.pyplot as plt
  ImportError                               Traceback (most recent call last)
  &lt;ipython-input-2-eff513f636fd&gt; in &lt;module&gt;()
  ----&gt; 1 import matplotlib.pyplot as plt
  /Users/r8t/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.py in &lt;module&gt;()
       25
       26 import matplotlib
  ---&gt; 27 import matplotlib.colorbar
       28 from matplotlib import style
       29 from matplotlib import _pylab_helpers, interactive
  
  /Users/r8t/anaconda/lib/python2.7/site-packages/matplotlib/colorbar.py in &lt;module&gt;()
       32 import matplotlib.artist as martist
       33 import matplotlib.cbook as cbook
  ---&gt; 34 import matplotlib.collections as collections
       35 import matplotlib.colors as colors
       36 import matplotlib.contour as contour
  /Users/r8t/anaconda/lib/python2.7/site-packages/matplotlib/collections.py in &lt;module&gt;()
       25 import matplotlib.artist as artist
       26 from matplotlib.artist import allow_rasterization
  ---&gt; 27 import matplotlib.backend_bases as backend_bases
       28 import matplotlib.path as mpath
       29 from matplotlib import _path
  /Users/r8t/anaconda/lib/python2.7/site-packages/matplotlib/backend_bases.py in &lt;module&gt;()
       54
       55 import matplotlib.tight_bbox as tight_bbox
  ---&gt; 56 import matplotlib.textpath as textpath
       57 from matplotlib.path import Path
       58 from matplotlib.cbook import mplDeprecation
  /Users/r8t/anaconda/lib/python2.7/site-packages/matplotlib/textpath.py in &lt;module&gt;()
       20 from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, LOAD_NO_HINTING
       21 from matplotlib.ft2font import LOAD_TARGET_LIGHT
   ---&gt; 22 from matplotlib.mathtext import MathTextParser
       23 import matplotlib.dviread as dviread
       24 from matplotlib.font_manager import FontProperties
  
  /Users/r8t/anaconda/lib/python2.7/site-packages/matplotlib/mathtext.py in &lt;module&gt;()
       61
       62 import matplotlib.colors as mcolors
  ---&gt; 63 import matplotlib._png as _png
       64 ####################
       65
   ImportError: dlopen(/Users/r8t/anaconda/lib/python2.7/site-packages/matplotlib/_png.so, 2): Library   not loaded: libpng15.15.dylib
    Referenced from: /Users/r8t/anaconda/lib/python2.7/site-packages/matplotlib/_png.so
    Reason: image not found
  </code></pre>
  
  <p>I've looked at <a href="https://stackoverflow.com/questions/13292396/error-importing-matplotlib-pyplot">Error importing matplotlib.pyplot</a>
  which suggests deleting the matplotlib folder. I tried it and it didn't work.  This also doesn't have a solution, but I think is related: <a href="https://stackoverflow.com/questions/12044043/python-py2app-importerror-dlopen-library-not-loaded">Python: py2app &quot;ImportError: dlopen(): Library not loaded&quot;</a></p>
  
  <p>Also i made sure I have libpng installed (via brew). 
  Thanks, </p>