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

VSCode中无法启动Jupyter Notebook内核问题求助

解决VSCode中Jupyter内核无法连接的问题

问题详情

VSCode启动Jupyter内核失败,报错信息如下:

Failed to start the Kernel. 
C:\Users\Theodore\AppData\Roaming\Python\Python310\site-packages\traitlets\traitlets.py:2412: 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:\Users\Theodore\AppData\Roaming\Python\Python310\site-packages\traitlets\traitlets.py:2366: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '7d0f2f44-841e-4868-9c82-374720d9f73e' instead of 'b"7d0f2f44-841e-4868-9c82-374720d9f73e"'.
  warn(
Bad address (C:\projects\libzmq\src\epoll.cpp:100). 
View Jupyter log for further details.

环境信息:

  • Python版本:3.10.4
  • Jupyter Notebook版本:6.4.12
  • 切换Anaconda内核同样失效,偶尔提示需重新安装ipykernel

解决方案

  • 修复traitlets版本兼容问题
    Jupyter Notebook 6.4.12与traitlets 5.x存在兼容问题,执行命令降级到稳定兼容版本:

    pip install traitlets==4.3.3
    
  • 重新安装pyzmq解决网络地址错误
    卸载现有pyzmq并安装适配Windows Python3.10的稳定版本:

    pip uninstall -y pyzmq
    pip install pyzmq==23.2.0
    
  • 重装并注册ipykernel
    针对当前Python环境升级ipykernel:

    pip install --upgrade ipykernel
    

    若使用Anaconda环境,激活目标环境后执行:

    conda install -c anaconda ipykernel
    python -m ipykernel install --user --name=your_env_name
    

    替换your_env_name为你的Anaconda环境名称。

  • 重置VSCode Jupyter配置

    1. 打开VSCode,按Ctrl+Shift+P调出命令面板,输入Jupyter: Reset Jupyter Server并执行
    2. 关闭VSCode,删除用户目录下的.jupyter文件夹(路径:C:\Users\Theodore\.jupyter)
    3. 重新启动VSCode,尝试重新连接内核

内容的提问来源于stack exchange,提问作者Theodore Maximus

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.14 02:35:40