如何在VS Code Jupyter Notebook中导入Pandas

huangapple go评论77阅读模式
英文:

How to Import Pandas in a VS Code Jupyter Notebook

问题

我是您的中文翻译,以下是已翻译好的内容:

"我对编程相当新,之前的经验都是在Jupyter Notebook上,但现在被要求转到VS Code。我已经安装了Jupyter和Python扩展,并且目前正在一个ipynb文件中工作,可以正常编写和运行常规代码。然而,当我尝试 import pandas as pd 时,我收到一个ModuleNotFoundError,显示没有名为 'pandas' 的模块。我尝试在VS Code终端和常规的Mac终端中都运行了 pip install pandas,但仍然出现了错误。我也在我的电脑上安装了anaconda,如果这个相关的话。抱歉,我确定这是一个非常简单的错误,但我对如何导入Pandas或其他库不熟悉。任何帮助都将不胜感激,我会尽快回应。谢谢!"

英文:

I'm fairly new to coding, and all my previous experience has been with Jupyter Notebook, but I've been asked to switch to VS Code. I've installed the Jupyter and Python extensions, and I'm currently working in an ipynb file, where I can write and run regular code normally. However, when I try import pandas as pd, I get a ModuleNotFoundError saying that there's no module named 'pandas.' I tried pip install pandas, both in the VS Code terminal and the regular Mac terminal, but I'm still getting the error. I've also installed anaconda on my computer if that's relevant. Sorry, I'm sure it's a very simple error but I'm not familiar enough with this to understand how to import Pandas or other libraries. Any help is appreciated, and I'll try to respond promptly. Thanks!

答案1

得分: 0

点击右上角的内核版本,然后选择安装了 pandas 的内核。

英文:

Click on the kernel version in the upper right corner, and then select the kernel that installed pandas

如何在VS Code Jupyter Notebook中导入Pandas

huangapple
  • 本文由 发表于 2023年6月8日 10:06:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76428143.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定