matplotlib
时,我遇到了以下错误:
At some point in the last few days, Matplotlib stopped working for me on OS X. Here's the error I get when trying to import matplotlib
:
Traceback (most recent call last):
File "/my/path/to/script/my_script.py", line 15, in <module>
import matplotlib.pyplot as plt
File "/Library/Python/2.7/site-packages/matplotlib/pyplot.py", line 34, in <module>
from matplotlib.figure import Figure, figaspect
File "/Library/Python/2.7/site-packages/matplotlib/figure.py", line 40, in <module>
from matplotlib.axes import Axes, SubplotBase, subplot_class_factory
File "/Library/Python/2.7/site-packages/matplotlib/axes/__init__.py", line 4, in <module>
from ._subplots import *
File "/Library/Python/2.7/site-packages/matplotlib/axes/_subplots.py", line 10, in <module>
from matplotlib.axes._axes import Axes
File "/Library/Python/2.7/site-packages/matplotlib/axes/_axes.py", line 22, in <module>
import matplotlib.dates as _ # <-registers a date unit converter
File "/Library/Python/2.7/site-packages/matplotlib/dates.py", line 126, in <module>
from dateutil.rrule import (rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY,
File "/Library/Python/2.7/site-packages/dateutil/rrule.py", line 14, in <module>
from six.moves import _thread
ImportError: cannot import name _thread
我能想到的唯一系统更改是苹果强制的NTP更新,以及我在/usr/local进行的一些权限更改,以使Brew再次工作。
我尝试通过Pip重新安装Matplotlib和Python-dateutil,但这没有帮助。也尝试了重启。我正在运行Python 2.7.6,它位于/usr/bin/python中。我正在运行Yosemite(OS X 10.10.1)。
six
版本也可以解决问题。 - tacaswell