转载自 http://blog.csdn.net/qq_16568981/article/details/71750789
jupyter kernel error
Jupyter Notebook出现kernel error
当时用Anaconda安装多个版本的Python的时候,时常由于安装和卸载多次Python导致Juoyter notebook不可用。常常导致如下结果
File”//anaconda/lib/python2.7/site-packages/jupyter_client/manager.py”, line 190, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File “//anaconda/lib/python2.7/site-packages/jupyter_client/launcher.py”, line 123, in launch_kernel
proc = Popen(cmd, **kwargs)
File “//anaconda/lib/python2.7/subprocess.py”, line 710, in init
errread, errwrite)
File “//anaconda/lib/python2.7/subprocess.py”, line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or director
解决办法
- 首先使用
jupyter kernelspec list
查看安装的内核和位置 - 进入安装内核目录打开kernel.jason文件,查看Python编译器的路径是否正确
- 如果不正确
python -m ipykernel install --user
重新安装内核,如果有多个内核,如果你使用conda create -n python2 python=2
,为Python2.7设置conda变量,那么在anacoda下使用activate pyhton2
切换python环境,重新使用python -m ipykernel install --user
安装内核 - 重启jupyter notebook即可