Python 内核无法在 Jupyter 笔记本中启动

时间:2021-07-22 04:48:07

标签: python jupyter-notebook python-asyncio tornado

我在我的 Windows PC 上使用 Jupyter 已经很长时间了,没有出现任何问题。昨天打开 Jupyter 时,Web 浏览器中的主窗口打开,但当我尝试创建新文件时内核无法启动。

这部分工作正常并打开 jupyter 浏览器窗口

PS C:\Users\ntink> jupyter notebook

[I 10:03:02.983 NotebookApp] JupyterLab extension loaded from c:\users\ntink\appdata\local\programs\python\python38\lib\site-packages\jupyterlab
[I 10:03:02.984 NotebookApp] JupyterLab application directory is C:\Users\ntink\AppData\Local\Programs\Python\Python38\share\jupyter\lab
[I 10:03:02.993 NotebookApp] Serving notebooks from local directory: C:\Users\ntink
[I 10:03:02.993 NotebookApp] Jupyter Notebook 6.4.0 is running at:
[I 10:03:02.994 NotebookApp] http://localhost:8888/?token=df916b72450995d42810037217ca24867ee6e88b1b607e16
[I 10:03:02.995 NotebookApp]  or http://127.0.0.1:8888/?token=df916b72450995d42810037217ca24867ee6e88b1b607e16
[I 10:03:02.996 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 10:03:03.101 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///C:/Users/ntink/AppData/Roaming/jupyter/runtime/nbserver-8220-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=df916b72450995d42810037217ca24867ee6e88b1b607e16
     or http://127.0.0.1:8888/?token=df916b72450995d42810037217ca24867ee6e88b1b607e16

但是在创建新的 Python3 笔记本时,内核失败

[I 10:03:18.232 NotebookApp] Creating new notebook in
[I 10:03:21.248 NotebookApp] Kernel started: 7a3a78c5-504b-48bc-b561-43dc9b9823b0, name: python3
Traceback (most recent call last):
  File "c:\users\ntink\appdata\local\programs\python\python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\ntink\appdata\local\programs\python\python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\users\ntink\appdata\local\programs\python\python38\lib\site-packages\ipykernel\__main__.py", line 3, in <module>
    app.launch_new_instance()
  File "c:\users\ntink\appdata\local\programs\python\python38\lib\site-packages\traitlets\config\application.py", line 845, in launch_instance
    app.start()
  File "c:\users\ntink\appdata\local\programs\python\python38\lib\site-packages\ipykernel\kernelapp.py", line 474, in start
    ioloop.IOLoop.instance().start()
  File "c:\users\ntink\appdata\local\programs\python\python38\lib\site-packages\tornado\platform\asyncio.py", line 199, in start
    self.asyncio_loop.run_forever()
  File "c:\users\ntink\appdata\local\programs\python\python38\lib\asyncio\windows_events.py", line 314, in run_forever
    assert self._self_reading_future is None
AssertionError

 

我怀疑是升级包导致了这个问题,我尝试重新安装 jupyter 及其依赖项、asyncio 和 Tornado,但无济于事。当我尝试打开现有的 jupyter 笔记本时,我遇到了类似的内核错误。

这里是安装包的详细信息。提前致谢,我一直无法弄清楚这一点,这让我发疯了。

Package Version
async-generator 1.1
asyncio 3.4.3
jenkinsapi  0.3.9
Jinja2  2.9.4
jupyter-client  6.1.12
jupyter-core    4.7.1
jupyterlab  0.35.4
jupyterlab-pygments 0.1.2
jupyterlab-server   0.2.0
nbclient    0.5.3
nbconvert   6.1.0
nbformat    5.1.3
notebook    6.4.0
pip 21.1.3
terminado   0.10.1
tornado 6.1

0 个答案:

没有答案
相关问题