简体   繁体   English

ModuleNotFound seaborn 在 Python 3

[英]ModuleNotFound seaborn in Python 3

I'm trying to use the seaborn module in the Spyder IDE.我正在尝试在 Spyder IDE 中使用 seaborn 模块。 I've installed seaborn (and sklearn) through pip install (pip install seaborn, pip3 install seaborn, pip -m install seaborn, conda install seaborn). I've installed seaborn (and sklearn) through pip install (pip install seaborn, pip3 install seaborn, pip -m install seaborn, conda install seaborn). I've also tried uninstalling it and installing it again.我也试过卸载它并重新安装它。 I see it in my pip list.我在我的 pip 列表中看到它。 But when I go into Spyder and actually try to import it using "import seaborn as sns", it says "mo module named 'seaborn'".但是当我将 go 导入 Spyder 并实际尝试使用“import seaborn as sns”导入它时,它显示“mo module named 'seaborn'”。

I've installed other modules (pandas, numpy, etc), so I'm pretty sure my PATH is set appropriately.我已经安装了其他模块(熊猫、numpy 等),所以我很确定我的 PATH 设置正确。 I found another thread but it was all about starting virtual environments to work with seaborn, which I'd rather not do.我找到了另一个线程,但这都是关于启动虚拟环境以使用 seaborn,我宁愿不这样做。

Any ideas?有任何想法吗? Please keep in mind that I'm fairly a newbie, so I have a basic IDE setup.请记住,我是一个新手,所以我有一个基本的 IDE 设置。

You may want to check whether the Spyder you are using is the correct one.您可能需要检查您使用的 Spyder 是否正确。 You can check this with which spyder from the commandline.您可以从命令行使用which spyder进行检查。 It should report Spyder being in the same directory as pip and python are.它应该报告 Spyder 与pippython位于同一目录中。 Also, check if you can import Seaborn when you are in a normal Python terminal.另外,当您在正常的 Python 终端中时,请检查是否可以导入 Seaborn。 This will help tracking down what part of this operation is the issue.这将有助于追踪该操作的哪一部分是问题所在。

Spyder also has a console of its own. Spyder 也有自己的控制台。 Try pip install seaborn in that terminal.尝试在该终端中pip install seaborn Hopefully it will solve your problem.希望它能解决你的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM