jupyter 添加不同内核

不论是jupyter notebook 还是 jupyter lab 都可以添加多个 python 内核,并且随意切换。

1、切换到要添加的虚拟环境,确认是否安装 ipykernel

python -m ipykernel --version

如果没有安装,则安装:

python -m pip install ipykernel


2、为 Jupyter 添加内核

python -m ipykernel install --user --name=python3 --display-name py37


3、查看 Jupyter notebook kernel

jupyter kernelspec list

4、删除  jupyter 内核

jupyter kernelspec remove kernelname

 

5、切换内核

示例:

 

conda install -n 环境名称 ipykernel



原文地址:https://www.cnblogs.com/shanger/p/12006322.html