Jupyter notebook切换内核(anaconda环境)

  1. 激活新环境

conda activate envName
  1. 在新环境中安装ipykernel

conda install ipykernel
  1. 手动添加kernel到jupyter notebook

python -m ipykernel install --name envName --display-name "kernelName"

例如:

python -m ipykernel install --name pytorch_gpu --display-name "Python(pytorch_gpu)"
  1. 重启jupyter notebook

jupyter notebook
  1. 添加成功

Jupyter notebook切换内核(anaconda环境)_第1张图片

你可能感兴趣的:(Python,jupyter,python)