I successfully installed Anaconda, Python2.7, and matplotlib on my Mac OS laptop.
However, when I import matplotlib.pyplot
, I get the following errors:
Python 2.7.14 |Anaconda custom (64-bit)| (default, Oct 5 2017, 02:28:52)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/user.name/anaconda2/lib/python2.7/site-packages/matplotlib/pyplot.py", line 32, in <module>
import matplotlib.colorbar
File "/Users/user.name/anaconda2/lib/python2.7/site-packages/matplotlib/colorbar.py", line 36, in <module>
import matplotlib.contour as contour
File "/Users/user.name/anaconda2/lib/python2.7/site-packages/matplotlib/contour.py", line 21, in <module>
import matplotlib.font_manager as font_manager
File "/Users/user.name/anaconda2/lib/python2.7/site-packages/matplotlib/font_manager.py", line 58, in <module>
from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir
ImportError: dlopen(/Users/user.name/anaconda2/lib/python2.7/site-packages/matplotlib/ft2font.so, 2): Symbol not found: _inflateValidate
Referenced from: /Users/user.name/anaconda2/lib/libpng16.16.dylib
Expected in: /usr/lib/libz.1.dylib
in /Users/user.name/anaconda2/lib/libpng16.16.dylib
>>>
Here are the Conda versions of the libraries mentioned above in the error messages:
conda list matplotlib
# packages in environment at /Users/user.name/anaconda2:
#
# Name Version Build Channel
matplotlib 2.1.2 py27h6d6146d_0
conda list libpng
# packages in environment at /Users/user.name/anaconda2:
#
# Name Version Build Channel
libpng 1.6.34 he12f830_0
conda list zlib
# packages in environment at /Users/user.name/anaconda2:
#
# Name Version Build Channel
zlib 1.2.11 hf3cbc9b_2
Does anyone know how to fix this problem?