python 无法在Visual Studio代码中选择内核,findKernel崩溃:503服务不可用

m528fe3b  于 2023-03-16  发布在  Python
关注(0)|答案(2)|浏览(200)

我正在使用Visual Studio代码和Jupyter扩展(ms-toolsai.jupyter)版本2021.8.1054968649,我正在通过ssh连接到容器(所以我同时使用Remote - Container和Remote - SSH)。由于各种原因我不能使用默认的本地版本的Jupyter,我必须在现有的Jupyter笔记本上运行。它曾经工作,但是现在扩展找不到任何内核(应该是最右边的一个选项):

当我尝试启动第一个单元格时,它建议我选择一个内核,但没有:

查看日志后,我似乎收到错误503

Error 2021-07-27 17:23:09: findKernel crashed [t [Error]: Invalid response: 503 Service Unavailable
    at /home_local/user/.vscode-server/extensions/ms-toolsai.jupyter-2021.8.1054968649/out/client/node_modules/@jupyterlab/services.js:3:492374
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async m.getRunningKernels (/home_local/user/.vscode-server/extensions/ms-toolsai.jupyter-2021.8.1054968649/out/client/extension.js:90:227410)
    at async Promise.all (index 0)
    at async y.listKernels (/home_local/user/.vscode-server/extensions/ms-toolsai.jupyter-2021.8.1054968649/out/client/extension.js:90:468689)] {
  response: N [Response] {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: false, error: null },
    [Symbol(Response internals)]: {
      url: 'http://distant_adress:8888/api/kernels?1627399389810',
      status: 503,
      statusText: 'Service Unavailable',
      headers: [I [Headers]],
      counter: 0
    }
  }
}

其中distant_address是命令jupyter notebook list给出的地址,user只是我在linux上的用户名。
我已经试过了

  • 重新启动jupyter并更改地址:不起作用
  • 由于我也有一个端口转发,请转到我的计算机上的本地地址,而不是服务器上的地址:不工作(但是我机器上的Jupyter与端口转发配合良好)
bn31dyow

bn31dyow1#

我刚刚遇到了同样的问题。不是一个令人满意的答案,但卸载jupyter扩展,重新加载vs代码,并重新安装修复了它:/

mqkwyuun

mqkwyuun2#

更新Jupyter扩展,为我做了这项工作。我不确定它是否会为其他人工作。

相关问题

微信公众号