I had python 2.7.6 installed on OS X yosemite, which has always worked fine, until I tried to install matplotlib with pip. I got the same error below and upgraded to 2.7.9, used pip to upgrade all the packages, but still get the same error.
>>> import matplotlib Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Python/2.7/site-packages/matplotlib/__init__.py", line 180, in <module> from matplotlib.cbook import is_string_like File "/Library/Python/2.7/site-packages/matplotlib/cbook.py", line 33, in <module> import numpy as np File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py", line 170, in <module> from . import add_newdocs File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module> from numpy.lib import add_newdoc File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/__init__.py", line 18, in <module> from .polynomial import * File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/polynomial.py", line 19, in <module> from numpy.linalg import eigvals, lstsq, inv File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/linalg/__init__.py", line 51, in <module> from .linalg import * File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 29, in <module> from numpy.linalg import lapack_lite, _umath_linalg ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/linalg/lapack_lite.so, 2): Symbol not found: __gfortran_compare_string Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/linalg/lapack_lite.so Expected in: flat namespace in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/linalg/lapack_lite.so -- https://mail.python.org/mailman/listinfo/python-list