我正在尝试在 MacOSX (10.8.3) 上将 matplotlib 与 Python 2.7.3 一起使用,但是当我尝试导入 matplotlib.figure 时出现以下错误:
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 - 在 Mac OSX Snow Leopard 中安装 matplotlib
我仍然得到同样的错误。我很困惑为什么会发生这个错误以及如何解决它......
任何潜在的解决方案?