pandas Jupyter Notebook - ModuleNotFoundError

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/52877531/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 06:05:47  来源:igfitidea点击:

Jupyter Notebook - ModuleNotFoundError

pythonpandasnumpypipjupyter-notebook

提问by the_coder

I have Python 3.7 installed on my windows 10 laptop. i installed pandas and numpy a few days ago on my laptop and they worked fine when used in my jupyter notebook by writing import numpy as npand import pandas as pd. But today when i started my jupyter notebook again to practice the same error occurred a quite a few times. ModuleNotFoundError: No module named 'numpy'

我的 Windows 10 笔记本电脑上安装了 Python 3.7。几天前我在我的笔记本电脑上安装了 pandas 和 numpy 并且它们在我的 jupyter 笔记本中通过编写import numpy as npimport pandas as pd. 但是今天当我再次启动我的 jupyter notebook 来练习时,同样的错误发生了好几次。 ModuleNotFoundError: No module named 'numpy'

I tried restarting the jupyter kernel many times and then executed the statement again and again but the same error displayed each time.

我多次尝试重新启动 jupyter 内核,然后一次又一次地执行该语句,但每次都显示相同的错误。

I've installed numpy using pip install numpyand pandas using pip install pandas

我已经安装了 numpy usingpip install numpy和 pandas usingpip install pandas

i already tried installing pandas and numpy through my jupyter notebook using !pip install numpyand !pip install pandasbut the problem remains the same. Check out the below screenshots. Click on the link to view.

我已经尝试通过我的 jupyter notebook 安装 pandas 和 numpy !pip install numpy!pip install pandas但问题仍然存在。查看以下屏幕截图。点击链接查看。

pandas error

Pandas错误

numpy error

错误

I'm still learning python so can you please help me with this. I don't know what to do.

我还在学习python,所以你能帮我解决这个问题吗?我不知道该怎么办。

回答by pyeR_biz

Open a notebook. Install your packages through the notebook by entering in a notebook cell -

打开笔记本。通过输入笔记本单元格通过笔记本安装您的软件包 -

!pip install numpy
!pip install pandas

Then import

然后导入