python - 无法在 Visual Studio 代码中选择内核,findKernel 崩溃 : 503 Service Unavailable

标签 python visual-studio-code jupyter-notebook

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

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

查看日志后,我似乎收到错误 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_adress 是命令 jupyter notebook list 给出的地址,user 只是我在 linux 上的用户名。

我已经试过了:

  • 重启 jupyter 并更改地址:不起作用
  • 因为我也有一个端口转发,所以转到我计算机上的本地地址而不是服务器上的本地地址:不起作用(但是我机器上的 jupyter 与端口转发配合得很好)

最佳答案

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

关于python - 无法在 Visual Studio 代码中选择内核,findKernel 崩溃 : 503 Service Unavailable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68547781/

相关文章:

python - jupyter-notebook:循环打印精细表格

python - gensim 是如何快速找到最相似的单词的?

debugging - VSCode 中 NPM Google Cloud 包的 Source Map 问题

vue.js - 如何获取从 .vue 中的别名导入的模块方法的智能感知

reactjs - TypeScript 可选属性不接受未定义的值

python - ipython 笔记本中的中心对齐输出

python - 从表单获取数据,但根据 Flask 所在的页面运行函数

python - 在 Github 页面上托管由 Pelican 驱动的博客

python - Google App Engine Python 数据存储

linux - 为什么 sklearn 中的核心事件在时间 RFECV/LogisticRegression 后减少