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


解决办法

  1. 首先使用jupyter kernelspec list查看安装的内核和位置
  2. 进入安装内核目录打开kernel.jason文件,查看Python编译器的路径是否正确
  3. 如果不正确python -m ipykernel install --user重新安装内核,如果有多个内核,如果你使用conda create -n python2 python=2,为Python2.7设置conda变量,那么在anacoda下使用activate pyhton2切换python环境,重新使用python -m ipykernel install --user安装内核
  4. 重启jupyter notebook即可

你可能感兴趣的:(Jupyter,Notebook使用)