Jupyter笔记本 - Dead Kernel
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Jupyter笔记本 - Dead Kernel相关的知识,希望对你有一定的参考价值。
我正在尝试使用jupyter笔记本,但是当我打开文件时收到以下错误:
内核已经死亡,自动重启失败。内核无法重新启动。如果您无法重新启动内核,您仍然可以保存笔记本,但在重新打开笔记本之前,运行代码将不再有效。
在CMD中,我看到以下内容:
(base) C:UsersDan Eran>jupyter notebook
[W 19:05:33.006 NotebookApp] Error loading server extension jupyterlab
Traceback (most recent call last):
File "C:UsersDan EranAppDataRoamingPythonPython36site-packages
otebook
otebookapp.py", line 1451, in init_server_extensions
mod = importlib.import_module(modulename)
File "C:Anaconda3libimportlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'jupyterlab'
[I 19:05:33.122 NotebookApp] Serving notebooks from local directory: C:UsersDan Eran
[I 19:05:33.122 NotebookApp] 0 active kernels
[I 19:05:33.122 NotebookApp] The Jupyter Notebook is running at:
[I 19:05:33.122 NotebookApp] http://localhost:8888/?token=99a355c23c6617857e387f53d0af607ae26b89c20598336e
[I 19:05:33.122 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 19:05:33.122 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=99a355c23c6617857e387f53d0af607ae26b89c20598336e
[I 19:05:33.247 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[I 19:05:42.699 NotebookApp] Creating new notebook in
[I 19:05:43.563 NotebookApp] Kernel started: 1433cbbf-f4b9-4dd3-be19-e91d7ee3d82f
Traceback (most recent call last):
File "C:Anaconda3lib
unpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:Anaconda3lib
unpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:Anaconda3libsite-packagesipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:Anaconda3libsite-packagesipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:Anaconda3libsite-packagesipykernelconnect.py", line 13, in <module>
from IPython.core.profiledir import ProfileDir
ModuleNotFoundError: No module named 'IPython'
[I 19:05:46.555 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
Traceback (most recent call last):
File "C:Anaconda3lib
unpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:Anaconda3lib
unpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:Anaconda3libsite-packagesipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:Anaconda3libsite-packagesipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:Anaconda3libsite-packagesipykernelconnect.py", line 13, in <module>
from IPython.core.profiledir import ProfileDir
ModuleNotFoundError: No module named 'IPython'
[I 19:05:49.591 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports
Traceback (most recent call last):
File "C:Anaconda3lib
unpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:Anaconda3lib
unpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:Anaconda3libsite-packagesipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:Anaconda3libsite-packagesipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:Anaconda3libsite-packagesipykernelconnect.py", line 13, in <module>
from IPython.core.profiledir import ProfileDir
ModuleNotFoundError: No module named 'IPython'
[I 19:05:52.620 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports
Traceback (most recent call last):
File "C:Anaconda3lib
unpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:Anaconda3lib
unpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:Anaconda3libsite-packagesipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:Anaconda3libsite-packagesipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:Anaconda3libsite-packagesipykernelconnect.py", line 13, in <module>
from IPython.core.profiledir import ProfileDir
ModuleNotFoundError: No module named 'IPython'
[W 19:05:53.595 NotebookApp] Timeout waiting for kernel_info reply from 1433cbbf-f4b9-4dd3-be19-e91d7ee3d82f
[I 19:05:55.632 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
WARNING:root:kernel 1433cbbf-f4b9-4dd3-be19-e91d7ee3d82f restarted
Traceback (most recent call last):
File "C:Anaconda3lib
unpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:Anaconda3lib
unpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:Anaconda3libsite-packagesipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:Anaconda3libsite-packagesipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:Anaconda3libsite-packagesipykernelconnect.py", line 13, in <module>
from IPython.core.profiledir import ProfileDir
ModuleNotFoundError: No module named 'IPython'
[W 19:05:58.671 NotebookApp] KernelRestarter: restart failed
[W 19:05:58.671 NotebookApp] Kernel 1433cbbf-f4b9-4dd3-be19-e91d7ee3d82f died, removing from map.
ERROR:root:kernel 1433cbbf-f4b9-4dd3-be19-e91d7ee3d82f restarted failed!
[W 19:05:58.705 NotebookApp] 410 DELETE /api/sessions/fd456273-adb3-48cd-92f8-d531c9b8f7a8 (::1): Kernel deleted before session
[W 19:05:58.709 NotebookApp] Kernel deleted before session
[W 19:05:58.709 NotebookApp] 410 DELETE /api/sessions/fd456273-adb3-48cd-92f8-d531c9b8f7a8 (::1) 4.00ms referer=http://localhost:8888/notebooks/Untitled11.ipynb?kernel_name=python3
我试图卸载然后重新安装一些模块。但是,我无法解决问题。有任何想法吗?谢谢!!
答案
似乎jupyter安装有问题。我建议将anaconda升级到v5,默认情况下应安装jupyter(不确定v3是否属于这种情况,这种情况似乎在这种情况下使用)。如果你想坚持使用conda v3,请尝试使用conda install安装缺少的模块。
conda install -c conda-forge jupyterlab
conda install -c anaconda ipython
以上是关于Jupyter笔记本 - Dead Kernel的主要内容,如果未能解决你的问题,请参考以下文章