没有名为' matplotlib.pylot'

时间:2016-08-20 17:24:03

标签: python matplotlib jupyter

我从anaconda发行版安装了Python 3.5。

source:

我在jupyter笔记本上导入matplotlib,我收到与找不到模块有关的错误。

我尝试安装matplotlib,如下所示:

C:\Users\ananda>python
Python 3.5.2 |Anaconda 4.1.1 (64-bit)| (default, Jul  5 2016, 11:41:13) [MSC     v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

我不知道我在做什么,如何在这里使用matplotlib模块,我是否需要安装任何特定版本?

2 个答案:

答案 0 :(得分:1)

您尝试安装matplotlib似乎是正确的,但您正在寻找的子模块称为pyplot

试试吧:

>>> import matplotlib.pyplot as plt
>>> # No ImportError or similar, everything is fine

如果仍然出现错误,只需发布​​完整追溯。

希望这有帮助!

答案 1 :(得分:0)

even after having the matplotlib module if u get this error then try:

从matplotlib导入pyplot

c = [1,2,3,4,5,6]

pyplot.plot(c)

pyplot.show()

to check whether the matplotlib is installed or not,**go** to your anaconda 3 folder where u have installed then go to lib then go to site packages then check for matplotlib folder if u find it then the above process works fine i.e., from matplotlib import pyplot 
if u don't find then go to anaconda prompt or command prompt then install the matplotlib using pip install matplotlib.