在Spyder中导入matplotlib(OSX 10.6)

时间:2015-01-13 11:26:52

标签: python macos python-2.7 matplotlib spyder

在Spyder中导入matplotlib时,我得到以下内容:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/matplotlib/pyplot.py", line 27, in <module>
    import matplotlib.colorbar
  File "/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/matplotlib/colorbar.py", line 34, in <module>
    import matplotlib.collections as collections
  File "/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/matplotlib/collections.py", line 27, in <module>
    import matplotlib.backend_bases as backend_bases
  File "/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/matplotlib/backend_bases.py", line 56, in <module>
    import matplotlib.textpath as textpath
  File "/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/matplotlib/textpath.py", line 19, in <module>
    import matplotlib.font_manager as font_manager
  File "/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/matplotlib/font_manager.py", line 57, in <module>
    from matplotlib import ft2font
ImportError: dlopen(/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/matplotlib/ft2font.so, 2): Symbol not found: _inflateReset2
  Referenced from: /Applications/Spyder-Py2.app/Contents/MacOS/../Frameworks/libpng16.16.dylib
  Expected in: /usr/lib/libz.1.dylib
 in /Applications/Spyder-Py2.app/Contents/MacOS/../Frameworks/libpng16.16.dylib

我该怎么办?我真的不明白。我在mac OSX 10.6下运行

1 个答案:

答案 0 :(得分:2)

Spyder dev here )问题在于前一段时间Matplotlib团队所做的一些改变,这些改变让我们更难以支持Mac OSX 10.6。

要做到这一点,我们需要在我们的Mac应用程序中包含我们自己的zlib版本,并针对它编译每个包,这是我认为工作太多而且可能导致错误的原因。

这就是我将应用程序的最低要求版本更改为 10.7 的原因,我们可以在documentation site中看到。