我正尝试使用Jupyter Notebook,但打开文件时出现以下错误:
内核已停止运行,并且自动重启失败。可能无法重新启动内核。如果您无法重新启动内核,则仍然可以保存笔记本,但在重新打开笔记本之前无法运行代码。
在CMD中,我看到以下内容:
(base) C:\Users\Dan Eran>jupyter notebook
[W 19:05:33.006 NotebookApp] Error loading server extension jupyterlab
Traceback (most recent call last):
File "C:\Users\Dan Eran\AppData\Roaming\Python\Python36\site-packages\notebook\notebookapp.py", line 1451, in init_server_extensions
mod = importlib.import_module(modulename)
File "C:\Anaconda3\lib\importlib\__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:\Users\Dan 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:\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:\Anaconda3\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Anaconda3\lib\site-packages\ipykernel\connect.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:\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:\Anaconda3\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Anaconda3\lib\site-packages\ipykernel\connect.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:\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:\Anaconda3\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Anaconda3\lib\site-packages\ipykernel\connect.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:\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:\Anaconda3\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Anaconda3\lib\site-packages\ipykernel\connect.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:\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:\Anaconda3\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Anaconda3\lib\site-packages\ipykernel\connect.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
我尝试卸载并重新安装了一些模块,但是无法解决问题。有什么想法吗?谢谢!
Matplotlib正在构建字体缓存;可能需要一段时间。
- Abdur Rahman