Import "numpy" could not be resolved; ipynb in vscode

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

Import "numpy" could not be resolved; ipynb in vscode

问题

我在使用VSCode中的ipynb(jupyter notebook)文件时遇到了使用numpy模块的问题,在ipynb文件中无法正常工作。如果我创建一个新的.py文件并导入模块,就不会出现错误。有人能告诉我为什么会这样吗?

英文:

Im in trouble with using umpy module in ipynb(jupyter notebook) file in vscode, it doesn't work only in ipynb file. If I make new .py file and import modules, no error comes out.

Could anybody tell me why this happens?

答案1

得分: 3

点击右上角的内核版本,然后选择正确的内核(已安装numpy的那一个)。

Import "numpy" could not be resolved; ipynb in vscode

英文:

Click on the kernel version in the upper right corner, and then select the correct kernel (The one with numpy installed).

Import "numpy" could not be resolved; ipynb in vscode

huangapple
  • 本文由 发表于 2023年7月11日 14:06:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76659097.html
匿名

发表评论

匿名网友

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

确定