ModuleNotFoundError:没有名为"pandas"的模块-Jupyter [英] ModuleNotFoundError: No module named 'pandas' - Jupyter
问题描述
我经历过各种Stack Overflow问题,但没有答案为我解决了这个问题. 我可能没有看到一条东西".
I have been through the various Stack Overflow questions and non of the answers resolve the issue for me. It is likely a path 'thing' that I am not seeing.
已经安装了pandas
,它说在那里,但是numpy
将导入而pandas
不会导入.
Have installed pandas
, it says its there, but numpy
will import and pandas
won't.
有什么想法吗?我想念什么?
Any ideas? What am I missing?
如果我输入:
!pip3 install pandas
我得到:
Requirement already satisfied: pandas in c:\users\ron mcmillan\appdata\local\programs\python\python38\lib\site-packages (1.0.3)
Requirement already satisfied: pytz>=2017.2 in c:\users\ron mcmillan\appdata\local\programs\python\python38\lib\site-packages (from pandas) (2020.1)
Requirement already satisfied: numpy>=1.13.3 in c:\users\ron mcmillan\appdata\local\programs\python\python38\lib\site-packages (from pandas) (1.18.4)
Requirement already satisfied: python-dateutil>=2.6.1 in c:\users\ron mcmillan\appdata\local\programs\python\python38\lib\site-packages (from pandas) (2.8.1)
Requirement already satisfied: six>=1.5 in c:\users\ron mcmillan\appdata\local\programs\python\python38\lib\site-packages (from python-dateutil>=2.6.1->pandas) (1.14.0)
推荐答案
好的,我要给出一个全新的,有根据的答案.
Okay, I'm going to give a completely new, opinionated, answer.
您似乎至少已经安装了两个Python安装程序,一个安装在..python\python38
中,另一个安装在..\python\python38-32
中. pandas
安装在第一个上,而jupyter
运行在第二个上.您每个人都有一个pip
版本,以及Microsoft\WindowsApps
中的第三个版本.
It looks like you've got at least two installations of Python, one in ..python\python38
, and one in ..\python\python38-32
. pandas
is installed on the first, but jupyter
is running on the second. You've got a version of pip
for each, plus a third one in Microsoft\WindowsApps
.
这发生.
在Windows上,仅卸载计算机上所有版本的Python可能是安全的.然后下载适用于Windows的Miniconda .像pip
一样,Miniconda是Python的软件包管理器;但是与pip不同,它还可以安装非Python文件,这使各种事情变得更加容易.它被称为"Miniconda"以区别于"Anaconda",后者是conda
加上数据科学家可能需要的几乎所有软件包-Miniconda只是为您提供了软件包管理器conda
,然后您可以选择安装您要安装的软件包真正想要的.
On Windows, you are probably safe to just uninstall all the versions of Python on your computer. Then download Miniconda for Windows. Miniconda is, like pip
, a package manager for Python; but unlike pip, is able to also install non-Python files, which makes all sorts of things much easier. It's called 'Miniconda' to distinguish it from 'Anaconda', which is conda
plus almost all the packages a data scientist might need -- Miniconda just gives you the package manager conda
, and you can then choose to install what you actually want.
一旦安装了conda
,请创建一个新的conda环境(conda create -n MYNEWENV
-如果您有20分钟的时间,则
Once conda
is installed, create a new conda environment (conda create -n MYNEWENV
-- if you have twenty minutes then read the quickstart explanation) and then try to download everything with conda install...
您可以指定从哪个渠道"下载软件包,但可能不需要.只需尝试conda install jupyter numpy pandas
;或在 Conda云中查找所需内容.
You can specify which 'channel' you download packages from, but you probably don't need to. Just try conda install jupyter numpy pandas
; or search the Conda cloud for the specifics of whatever you want.
这篇关于ModuleNotFoundError:没有名为"pandas"的模块-Jupyter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!