我正在使用 python 和 matplotlib,但我的脚本崩溃了,所以我不得不关闭终端(Ubuntu 12.04、matplotib-1.1.0、python2.7)。现在,如果我尝试运行任何脚本,它就会在线崩溃
import matplotlib.pyplot as plt
出现以下错误
Traceback (most recent call last):
File "new.py", line 4, in <module>
import matplotlib.pyplot as plt
File "/usr/local/lib/python2.7/dist-packages/matplotlib-1.2.0-py2.7-linux-i686.egg/matplotlib/__init__.py", line 151, in <module>
from matplotlib.rcsetup import (defaultParams,
File "/usr/local/lib/python2.7/dist-packages/matplotlib-1.2.0-py2.7-linux-i686.egg/matplotlib/rcsetup.py", line 20, in <module>
from matplotlib.colors import is_color_like
File "/usr/local/lib/python2.7/dist-packages/matplotlib-1.2.0-py2.7-linux-i686.egg/matplotlib/colors.py", line 54, in <module>
import matplotlib.cbook as cbook
File "/usr/local/lib/python2.7/dist-packages/matplotlib-1.2.0-py2.7-linux-i686.egg/matplotlib/cbook.py", line 32, in <module>
import new
File "/home/federico/Documents/doc_uni/idraulica_ambientale/relazione/scripts/variabili/new.py", line 4, in <module>
import matplotlib.pyplot as plt
File "/usr/local/lib/python2.7/dist-packages/matplotlib-1.2.0-py2.7-linux-i686.egg/matplotlib/pyplot.py", line 23, in <module>
from matplotlib import _pylab_helpers, interactive
ImportError: cannot import name interactive
注意最后一行。我尝试从源代码和 pip 和 easy_install 删除和重新安装 matplotlib,但我无法摆脱它。如果我尝试从 python 解释器中导入,也会发生同样的错误。我还安装了 1.2.0 版来查看它是否有效,但它没有。