导入pylab时出现以下错误。我已经安装了 matplotlib版本 - 1.4.1和OS - Yosemite 10.10.2
>>> import pylab
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "//anaconda/lib/python2.7/site-packages/matplotlib-1.4.1-py2.7-macosx-10.5-x86_64.egg/pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "//anaconda/lib/python2.7/site-packages/matplotlib-1.4.1-py2.7-macosx-10.5-x86_64.egg/matplotlib/pylab.py", line 274, in <module>
from matplotlib.pyplot import *
File "//anaconda/lib/python2.7/site-packages/matplotlib-1.4.1-py2.7-macosx-10.5-x86_64.egg/matplotlib/pyplot.py", line 109, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "//anaconda/lib/python2.7/site-packages/matplotlib-1.4.1-py2.7-macosx-10.5-x86_64.egg/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "//anaconda/lib/python2.7/site-packages/matplotlib-1.4.1-py2.7-macosx-10.5-x86_64.egg/matplotlib/backends/backend_tkagg.py", line 6, in <module>
from six.moves import tkinter as Tk
File "//anaconda/lib/python2.7/site-packages/six-1.9.0-py2.7.egg/six.py", line 199, in load_module
mod = mod._resolve()
File "//anaconda/lib/python2.7/site-packages/six-1.9.0-py2.7.egg/six.py", line 113, in _resolve
return _import_module(self.mod)
File "//anaconda/lib/python2.7/site-packages/six-1.9.0-py2.7.egg/six.py", line 80, in _import_module
__import__(name)
File "//anaconda/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: dlopen(//anaconda/lib/python2.7/lib-dynload/_tkinter.so, 2): Library not loaded: /usr/X11/lib/libX11.6.dylib
Referenced from: /anaconda/lib/libtk8.5.dylib
Reason: image not found
对此问题的任何建议都将非常感谢。感谢。