【发布时间】:2018-08-16 14:02:22
【问题描述】:
在我升级到 Yosemite 之前,Python 代码运行良好。请问有什么想法吗?这是错误:
Traceback (most recent call last):
File "/Users/will/Downloads/legend_demo4.py", line 1, in <module>
import matplotlib.pyplot as plt
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py", line 26, in <module>
from matplotlib.figure import Figure, figaspect
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: /usr/X11/lib/libpng12.0.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
Reason: image not found
【问题讨论】:
-
尝试重新安装matplotlib。
-
我怀疑发生的事情是他们(苹果)在你下面移动了一个库,所以 mpl 正在寻找一个版本,但操作系统有另一个版本。
-
您能否提供有关 a) 如何安装 python b) 您如何尝试构建源代码的详细信息?
标签: python macos matplotlib osx-yosemite