目前,VScode中可以支持jupyter notebook,前提是在所用环境中对jupyter notebook已经完成安装。

在使用中,只需要新建一个文件,后缀改为.ipynb即可,正常情况下,VScode会自动识别。但是,在使用中发现没有自动识别所使用的工作环境。例如,本机使用TF环境,识别不到,自动去找到并使用了base环境中的juypyter。解决方法如下:

参考:

Problem 2

“Jupyter kernel cannot be started from a certain environment.”

VS code, with python extension, anaconda, neuron

what we need to do is to add the environment to Jupyter kernel

  1. 首先 pip list 检查是否在TF环境中安装有 ipykernel。如果没有,就pip install ipykernel。

2. 输入 python -m ipykernel install --name TF

一定注意空格

3.重新打开vscode,即可使用。

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐