本文介绍了即使安装了 pandas 模块也找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为此使用anaconda.我已经使用以下两种方式下载了熊猫:

I am using anaconda for this. I have downloaded pandas using both:

pip install pandas

conda install pandas

他们已成功安装,再次执行安装表明它们已安装.但是,当单独编写此行时

They successfully install, and doing the installation again shows that they are already installed. However, when writing this line alone

import pandas as pd

我收到此错误消息:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-3-7dd3504c366f> in <module>
----> 1 import pandas as pd

ModuleNotFoundError: No module named 'pandas'

我不知道该怎么办.

推荐答案

您不需要为此提供环境.解决此问题的真正方法是知道您实际使用的是什么 pip conda ,然后将这些东西安装在哪个 python 上.

You don't necesarilly need an environment for this.The real deal with this problem is to know what pip or conda you are actually using and then on which python will the stuff be installed.

您可以打开python和:

You can open python and:

import sys
sys.path

像这样,您可以知道python在哪里.转到该文件夹​​,您还将找到一个 pip .

Like this you can know where your python is. Go to that folder and you'll also find a pip.

然后您有两个选择:

1)在环境变量上设置此路径=>除非尝试进行另一个 python安装(然后是,请使用conda环境),否则您将永远不会遇到问题

1) Set this path on your environments variables => you won't ever have the problem unless you try to do another python installation (then yes, use conda environment )

2)在命令提示符下您的/pip/path/pip安装熊猫

2) In you command prompt your/pip/path/pip install pandas

这篇关于即使安装了 pandas 模块也找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 13:58