jupyter notebook启动是默认采用的是anaconda的base环境。下面将介绍如何给jupyter notebook指定新的环境:
conda新建python环境: conda create -n machinelearn python=3 切换新建的python环境中,安装ipykernel: source activate machinelearn pip install ipykernel -i https://pypi.tuna.tsinghua.edu.cn/simple 在 machinelearn 的环境中新建kernel(kernel名可与环境名一致): python -m ipykernel install --user --name machinelearn--display-name machinelearn至此,便可以在jupyter notebook中切换python为刚刚新建的machinelearn的环境。 并且kernel的配置文件在:/home/yxy/.local/share/jupyter/kernels。
2. 删除指定kernel:
jupyter kernelspec remove icsharpkernel刷新一下jupyter notebook即可。