You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VSCode中Jupyter Notebook启动Kernel报错的解决方法咨询

VSCode启动Jupyter Kernel失败的解决方法

问题详情

启动VSCode中的Jupyter Notebook Kernel时失败,报错信息如下:

Failed to start the Kernel. 
c:\ProgramData\Anaconda3\lib\site-packages\traitlets\traitlets.py:2202: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
  warn(
c:\ProgramData\Anaconda3\lib\site-packages\traitlets\traitlets.py:2157: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '650acb8e-de88-49d4-83a0-12cbf7a674c3' instead of 'b"650acb8e-de88-49d4-83a0-12cbf7a674c3"'.
  warn(
Bad file descriptor (bundled\zeromq\src\epoll.cpp:100).

(报错截图:Jupyter Kernel启动失败截图)

修复步骤

1. 升级traitlets包

报错明确提示traitlets 5.0已弃用字符串额外引号的写法,直接升级到最新兼容版本:

  • 使用conda:
    conda update traitlets -y
    
  • 使用pip:
    pip install --upgrade traitlets
    

2. 更新ZeroMQ相关依赖

Bad file descriptor错误与ZeroMQ组件有关,升级对应依赖包:

  • 使用conda:
    conda update pyzmq -y
    
  • 使用pip:
    pip install --upgrade pyzmq
    

3. 重置Jupyter配置

若配置文件存在格式异常,可重置配置:

  1. 执行命令定位Jupyter配置目录:
    jupyter --config-dir
    
  2. 删除该目录下的jupyter_notebook_config.py等配置文件
  3. 重启VSCode后重新启动Kernel

4. 更换Python环境测试

如果当前环境存在依赖冲突,新建干净环境测试:

conda create -n jupyter_fix python=3.10 -y
conda activate jupyter_fix
pip install jupyter

在VSCode中切换到这个新环境的Kernel,尝试启动。

内容的提问来源于stack exchange,提问作者Charlie Kou

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.23 07:15:51