Anaconda中安装了虚拟环境,但是再Jupyter Notebook页面无法切换Change kernel,通过下面步骤得以解决问题。
目录
一、base环境
在base环境中执行
conda install nb_conda_kernels
二、虚拟环境
2.1 查看存在的虚拟环境
conda env list
2.2 进入虚拟环境
activate 虚拟环境名称
再虚拟环境下执行:
conda install ipykernel
2.3 将你的环境添加到 Jupyter 的内核列表中
python -m ipykernel install --user --name=你的虚拟环境名称
三、报错处理
运行.pynb程序报错:
TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See...
解决办法
出现该问题的原因是未安装ipywidgets,所以 安装ipywidgets包即可。命令如下:
pip install ipywidgets
通过上述步骤即完全解决问题,可以在Jupyter Notebook中Change kernel。