VScode Jupyter Server: No Kernel Python: Not Started 问题解决

时间:2024-03-27 10:26:01

今天看vscode上的Python插件时,偶然发现已经支持直接在vscode上使用jupyter。jupyter用起来非常方便,但我不太习惯在浏览器上的界面,所以用的比较少。在发现这个功能后,就按照插件介绍里的步骤使用了一下,但是出现了bug,vscode上的jupyter显示找不到kernel,然后报错notebook failed to launch。
VScode Jupyter Server: No Kernel Python: Not Started 问题解决
谷歌了一圈发现,vscode的Python插件竟然是个开源项目,有微软的开发人员在github在线答疑。看了一下issues,有很多有一样问题的网友。在看了看issues区里大家的讨论之后,发现了以下几种解决问题的方法:

  1. 要选择好装有jupyter的Python解释器,如果使用conda的要**好conda环境。或者在点击vscode界面左下角的Python版本,可以选择你电脑上已有的Python解释器(包括conda里的虚拟环境)VScode Jupyter Server: No Kernel Python: Not Started 问题解决
  2. 如果cmd窗口已经弹出来了jupyter的后端信息,并且可以在浏览器正常运行,但vscode上仍然无法使用VScode Jupyter Server: No Kernel Python: Not Started 问题解决
    此时需要按F1,在vscode的命令输入框里输入“Select Interpreter to start Jupyter server”,然后手动选择你要选用的Python解释器,然后再随便运行一个Cell,vscode就会连接到这个kernel。微软的开发人员在github表示这是一个缓存方面的bug。
    VScode Jupyter Server: No Kernel Python: Not Started 问题解决
    Fixed.