title: Reinstalling Matplotlib on Mac
body: <p>I upgraded packages and broke my matplotlib installation. Now when I run <code>import matplotlib.pyplot as plt</code>, I get the following error:</p>
  
  <pre><code>ImportError: dlopen(/usr/local/lib/python2.7/site-packages/matplotlib/ft2font.so, 2):       
  Library not loaded: /usr/local/lib/libpng16.16.dylib
    Referenced from: /usr/local/lib/libfreetype.6.dylib
    Reason: image not found
  </code></pre>
  
  <p>To fix this, I uninstalled freetype and libpng using <code>brew</code>. Specifically, I used <code>brew uninstall freetype &amp;&amp; brew cleanup &amp;&amp; brew install freetype</code> and the same commands with <code>libpng</code>.
  The I reinstalled matplotlib (<code>pip uninstall matplotlib</code>, then <code>pip install matplotlib</code>).</p>
  
  <p>This did not fix it, and I don't know what the next step is to be able to have a working matplotlib (<code>.pyplot</code>) installation.</p>