英文:
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
的内核。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论