conda虚拟环境连接 Jupyter 内核

为让虚拟环境与 Jupyter 内核相连,请在 Prompt 的虚拟环境下操作下列命令

1
2
# 列出 Jupyter 的内核列表
jupyter kernelspec list
1
2
# 安装 ipykernel 
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ipykernel
1
2
3
4
# 将虚拟环境导入 Jupyter 的 kernel 中
python -m ipykernel install --user --name=环境名
# 删除虚拟环境的 kernel 内核
jupyter kernelspec remove 环境名