本文主要是介绍anaconda 中启动jupyter notebook找不到python2 kernerl,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
问题
- 在jupyter notebook中将kernel从python3切换到python2时,出现
Could not find a kernel matching Python 2. Please select a kernel
的错误
解决方法
- 查看已有的ipykernel环境
jupyter kernelspec list
如下图所示,表明python3的ipython内核已安装
Available kernels:python3 /home/ozh/.local/share/jupyter/kernels/python3
- 安装python2环境
conda create --name pythonn27 python=2.7 - 切换python环境
source activate python27 - 安装ipython内核
conda install ipykernel - 配置内核
python -m ipykernel install --user - 查看内核文件指向python版本
位置:~/.local/share/jupyter/kernels/python2/kernel.json
{"display_name": "Python 2","language": "python","argv": ["/home/ozh/anaconda3/envs/python27/bin/python","-m","ipykernel_launcher","-f","{connection_file}"]
}
这篇关于anaconda 中启动jupyter notebook找不到python2 kernerl的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!