鉴于python2.7与python3ban版本的不同yijip2ython代码有的需要在python2.7版本执行,有的需要在python3版本执行,所以可以在jupyter中安装多个python环境。我的情况有点复杂,参考很多其他博客。我安装的版本有
我以前主要使用python3,在命令行中使用jupyter notebook默认打开也是python3_64版本的,这个和安装单个jupyter没有什么两样,但最近我需要在python2_32位的运行环境,Anaconda2中可能已经安装好jupyter,但我没有使用下载好的,我重新安装
python2 -m pip install --upgrade pip --force-reinstall
python2 -m pip install jupyter
安装好后直接运行
jupyter notebook
但此时没有任何影响。还是打开的是python3版本的,此时我在考虑是不是python3中的jupyter添加到电脑的路径里了,我重新查看,并没有。然后查看更多资料,说是需要为jupyter notebook添加多个python 内核
添加内核
查看jupyter notebook 内核列表
jupyter kernelspec list
刚开始只有这一个,安装或删除其他内核
ipython kernel install --name python2&n