【问题标题】:Kernel Error in Jupyter Notebook, don't know what to do, am new to thisJupyter Notebook 中的内核错误,不知道该怎么办,我是新手
【发布时间】:2020-02-19 01:56:23
【问题描述】:

Traceback(最近一次通话最后一次):

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\tornado\web.py”,第 1699 行,在 _execute 中

result = await result

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\tornado\gen.py”,第 742 行,运行中

yielded = self.gen.throw(*exc_info)  # type: ignore

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\notebook\services\sessions\handlers.py”,第 72 行,在帖子中

type=mtype))

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\tornado\gen.py”,第 735 行,运行中

value = future.result()

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\tornado\gen.py”,第 742 行,运行中

yielded = self.gen.throw(*exc_info)  # type: ignore

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py”,第 88 行,在 create_session 中

kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\tornado\gen.py”,第 735 行,运行中

value = future.result()

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\tornado\gen.py”,第 742 行,运行中

yielded = self.gen.throw(*exc_info)  # type: ignore

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py”,第 101 行,在 start_kernel_for_session 中

self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\tornado\gen.py”,第 735 行,运行中

value = future.result()

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\tornado\gen.py”,第 209 行,在包装中

yielded = next(result)

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py”,第 168 行,在 start_kernel 中

super(MappingKernelManager, self).start_kernel(**kwargs)

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\jupyter_client\multikernelmanager.py”,第 110 行,在 start_kernel 中

km.start_kernel(**kwargs)

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\jupyter_client\manager.py”,第 240 行,在 start_kernel 中

self.write_connection_file()

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\jupyter_client\connect.py”,第 547 行,在 write_connection_file 中

kernel_name=self.kernel_name

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\jupyter_client\connect.py”,第 212 行,在 write_connection_file 中

with secure_write(fname) as f:

文件“C:\Users\Kath.000\Anaconda3\lib\contextlib.py”,第 112 行,输入

return next(self.gen)

文件“C:\Users\Kath.000\Anaconda3\lib\site-packages\jupyter_client\connect.py”,第 102 行,在secure_write中

with os.fdopen(os.open(fname, open_flag, 0o600), mode) as f:

PermissionError: [Errno 13] Permission denied: 'C:\Users\Kath.000\AppData\Roaming\jupyter\runtime\kernel-451bd345-5996-4658-8c31-dbdb280931d9.json'

【问题讨论】:

    标签: python jupyter-notebook anaconda


    【解决方案1】:

    我从您的日志中猜想您还安装了 Anaconda3。我昨天安装了适用于 Windows 的 Anaconda 2019.10,但我遇到了同样的错误。

    简单回答

    将anaconda降级到2019.07,也就是之前的版本。

    How to downgrade anacondafrom Anaconda Emvironments GUI.

    1. 打开 Anaconda 导航器。
    2. 更改为“环境”选项卡。
    3. 右键单击列表中的“anaconda”。
    4. 将鼠标光标滑动到“标记为特定版本安装”。
    5. 选择“2019.07”。
    6. 应用降级。

    2019-10-25 添加:在我尝试再次将 anaconda 升级到“2019.10”之后。 jupyter_client 变为ver.5.3.4,而不是ver.5.3.3。此更改解决了我的环境中的问题。

    2019-11-12 补充:同样的问题出现在另一台电脑上。我注意到“标记特定版本安装”在新安装后显示为灰色。运行“更新索引...”后启用“标记特定版本安装”。虽然我使用与上次相同的过程降级 anaconda,但您可能只需升级 anaconda 即可解决此问题。

    jupyter_client became ver.5.3.4

    长答案

    从这里开始, Kernel error in jupyter notebook #4909 .以下组件似乎是原因。

    • jupyter_client 5.3.3
    • pywin32 223

    解决方法如下。

    • 将 jupyter_client 降级到版本 5.3.1。
      • conda install jupyter_client=5.3.1
    • 或者将pywin32升级到224版。
      • conda 安装 pywin32=224

    我从 Anaconda Navigator 的 GUI 操作它们。但是,它们都不适用于我的 anaconda 环境。我从终端尝试了“conda install pywin32=224”,但它在处理过程中停止了。包之间的依赖关系可能会阻止这些操作。我不想花时间安装软件,所以我选择将 anaconda 降级到之前的版本。

    考虑采用此解决方案。

    此解决方案可防止您安装其他最新软件包。例如 numpy=1.16.4, scikit-learn=0.21.2 scipy=1.2.1 变得不可用。

    希望这些信息对您有所帮助。

    【讨论】:

      猜你喜欢
      • 2013-11-06
      • 2022-11-17
      • 1970-01-01
      • 2012-02-01
      • 1970-01-01
      • 2021-06-21
      • 2018-05-15
      • 2013-03-30
      • 1970-01-01
      相关资源
      最近更新 更多