Spyder因错误而崩溃:"内核似乎意外死亡。使用'重启内核'继续使用此控制台"

时间:2016-02-24 21:47:04

标签: python matplotlib spyder

我有一台64位Windows 7机器我正在使用Spyder 2.3.8与Python 2.7和Matplotlib 1.4.2(我试过Matplotlib 1.5.1并得到了同样的错误)

每次我导入matplotlib然后尝试用它进行绘图时,会弹出一个窗口并且有几次显示图形..但更多时候我得到重启内核错误。

代码非常简单:

from matplotlib import pyplot

x_values = [0, 4, 7, 20, 22, 25]
y_values = [0, 2, 4, 8, 16, 32]
pyplot.plot(x_values, y_values, "o-")

pyplot.ylabel("Value")
pyplot.xlabel("Time")
pyplot.title("Test plot")

pyplot.show()

1 个答案:

答案 0 :(得分:0)

您可以通过更新matplotlib来解决此问题。在我的情况下,通过这样做解决了。 要更新matplotlib,只需在终端上输入conda update matplotlib即可。 希望它能奏效!