Python 需要安装 ipykernel [英] Python requires ipykernel to be installed

查看:731
本文介绍了Python 需要安装 ipykernel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 VS 代码中使用 jupyter notebook 时遇到问题.屏幕显示Python 3.7.8 需要安装 ipykernel".如果我按照弹出窗口安装 ipykernel.它仍然不起作用.截图如附件所示.这让我很困扰.有人可以帮我吗?非常感谢.

然后,点击安装ipykernel";根据弹出框中的提示.或者,我们也可以安装ipykernel";手动:(pip install ipykernel)

另外,对于新创建的Python环境(没有安装ipykernel"),在打开Jupyter文件之前,请刷新VSCode终端,进入当前选择的环境.对于conda环境,使用前需要先激活.

检查:检查ipykernel"的安装:

更多参考:VSCode 中的环境.

I encounter an issue when I use the jupyter notebook in VS code. The screen shows "Python 3.7.8 requires ipykernel to be installed". If I followed the pop-up to intall the ipykernel. It still does not work. The screenshots are as attached. It bothers me a lot. Could anyone help me on it? Tons of thanks.enter image description here

enter image description here

解决方案

The reason is that your current VSCode terminal is in the environment "Deeplearning_Env", so "ipykernel" is installed in the environment "Deeplearning_Env" instead of the environment "base conda" displayed in the pop-up box.

Solution: Please use the shortcut key Ctrl+Shift+` to open a new VScode terminal, it will automatically enter the currently selected VSCode environment (VSCode lower left corner), and activate this conda environment:

Then, click to install "ipykernel" according to the prompt in the pop-up box. Or, we could also install "ipykernel" manually: (pip install ipykernel)

In addition, for the newly created Python environment (without installing "ipykernel"), before opening the Jupyter file, please refresh the VSCode terminal and enter the currently selected environment. For the conda environment, we need to activate it before using it.

Check: Check the installation of "ipykernel":

More reference: Environment in VSCode.

这篇关于Python 需要安装 ipykernel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆