一
随便一个终端,进要用的虚拟环境:
conda activate 虚拟环境名
二
安装 ipykernel
conda install ipykernel
三
把当前环境配置到 ipykernel 里去
python -m ipykernel install --user --name 环境名 --display-name 显示的名字
四
手动运行exe,或代码运行 jupyter
jupyter notebook
五
new 新文件的时候可以选择环境

也可在打开已有文件后,进行切换。如下:

六
从 jupyter 中删除虚拟环境 kernel:
打开jupyter 终端:

jupyter 终端 Terminal 中输入如下,显示当前存在的kernel的名字及其路径,其实上一张图里也能看出来 kernel 名叫啥。
jupyter kernelspec list

运行下面的语句删除 kernel:
jupyter kernelspec uninstall 名字

可以看到已经删除成功了。
网友评论