Jupyter Notebook打开后显示kernel dead(Kernel error)


报错信息如下:

Traceback (most recent call last):
File "C:\ProgramData\Anaconda2\lib\site-packages\tornado\web.py", line 1512, in _execute
result = yield result
File "C:\ProgramData\Anaconda2\lib\site-packages\tornado\gen.py", line 1055, in run
value = future.result()
File "C:\ProgramData\Anaconda2\lib\site-packages\tornado\concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "C:\ProgramData\Anaconda2\lib\site-packages\tornado\gen.py", line 1063, in run
yielded = self.gen.throw(*exc_info)
File "C:\ProgramData\Anaconda2\lib\site-packages\notebook\services\sessions\handlers.py", line 73, in post
type=mtype))
File "C:\ProgramData\Anaconda2\lib\site-packages\tornado\gen.py", line 1055, in run
value = future.result()
File "C:\ProgramData\Anaconda2\lib\site-packages\tornado\concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "C:\ProgramData\Anaconda2\lib\site-packages\tornado\gen.py", line 1063, in run
yielded = self.gen.throw(*exc_info)
File "C:\ProgramData\Anaconda2\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 79, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "C:\ProgramData\Anaconda2\lib\site-packages\tornado\gen.py", line 1055, in run
value = future.result()
File "C:\ProgramData\Anaconda2\lib\site-packages\tornado\concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "C:\ProgramData\Anaconda2\lib\site-packages\tornado\gen.py", line 1063, in run
yielded = self.gen.throw(*exc_info)
File "C:\ProgramData\Anaconda2\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 92, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "C:\ProgramData\Anaconda2\lib\site-packages\tornado\gen.py", line 1055, in run
value = future.result()
File "C:\ProgramData\Anaconda2\lib\site-packages\tornado\concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "C:\ProgramData\Anaconda2\lib\site-packages\tornado\gen.py", line 307, in wrapper
yielded = next(result)
File "C:\ProgramData\Anaconda2\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 148, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "C:\ProgramData\Anaconda2\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "C:\ProgramData\Anaconda2\lib\site-packages\jupyter_client\manager.py", line 258, in start_kernel
**kw)
File "C:\ProgramData\Anaconda2\lib\site-packages\jupyter_client\manager.py", line 203, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "C:\ProgramData\Anaconda2\lib\site-packages\jupyter_client\launcher.py", line 128, in launch_kernel
proc = Popen(cmd, **kwargs)
File "C:\ProgramData\Anaconda2\lib\subprocess.py", line 390, in init
errread, errwrite)
File "C:\ProgramData\Anaconda2\lib\subprocess.py", line 640, in _execute_child
startupinfo)

 

jupyter notebook没有读到正确的python 内核路径.有几种可能性,比如你反复下载了anaconda导致路径变更,或者是你修改了你的anaconda文件夹的名字,导致和jupyter notebook原本json设置的python 内核读取路径不对。

解决方法如下:

(1)在Anaconda Prompt中输入语句(对windows而言,linux或Max直接在终端输入查看)

jupyter kernelspec list

查看安装的内核及其位置 

(2)进入内核所在的目录,打开里面的kernel.jason文件,查看Python编译器的路径是否正确

如果不对则修改为正确的的python编译器路径。

通常为anaconda安装目录下的python.exe

Jupyter Notebook打开后显示kernel dead(Kernel error)_第1张图片

你可能感兴趣的:(杂文)