Matplotlib不适用于Sublime文本,但适用于Jupiter Notebook

时间:2019-03-10 21:07:50

标签: python matplotlib jupyter-notebook sublimetext3

使用Jupiter Notebook,我能够运行以下代码来显示简单图表。

put

现在,我在崇高文字中尝试了相同的操作,但它不起作用,我总是收到以下错误消息:

import matplotlib.pyplot as plt

squares = [1, 4, 9, 16, 25]
plt.plot(squares)
plt.show()

我尝试使用以下代码更改Python构建系统,但无法正常工作。

ModuleNotFoundError: No module named 'matplotlib'

有人知道我该如何移动matplotlib库才能在精美文字中使用它?

谢谢!

1 个答案:

答案 0 :(得分:0)

我通过删除anaconda(和matplotlib)并再次加载anaconda解决了我的问题。这可能有点奇怪,但是它可以正常工作,而我的简单代码示例现在可以正常工作。

为删除anaconda,我使用了以下手册: How to uninstall Anaconda completely from MacOS