我正在尝试在MacOSX(10.8.3)上使用matplotlib和Python 2.7.3,但是当我尝试导入matplotlib时,我收到以下错误:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import matplotlib.figure
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/figure.py", line 32, in <module>
from matplotlib.image import FigureImage
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/image.py", line 22, in <module>
import matplotlib._png as _png
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so, 2): Library not loaded: /opt/X11/lib/libpng15.15.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
Reason: Incompatible library version: _png.so requires version 27.0.0 or later, but libpng15.15.dylib provides version 20.0.0
在过去一周左右的时间里,我尝试使用来自几个不同来源的解决方案,最近一次是这个:
Python - Installing matplotlib in Mac OSX Snow Leopard
我仍然得到同样的错误。我很困惑为什么会发生这个错误以及如何修复它......
任何可能的解决方案?