环境:Mac OS
首先要安装Anaconda,这个我就不说了。
假设我们的base环境是python 3.6
在anaconda中打开jupyter notebook,此时使用右上角的new

应该是只有一个

这时候,再用anaconda创建一个新的2.7的环境,比如我们叫python27
在终端中切换到python27.
然后我们需要进行安装kernel
使用pip install ipykernel
然后执行python -m ipykernel --name python27
注意,这个名字可以跟环境名字不同,只是我这里使用了同一个名字
此时,重新打开jupyter notebook 就可以看到

这时候切换就比较方便了
网友评论