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配置
- 打开VSCode,按
Ctrl+Shift+P调出命令面板,输入Jupyter: Reset Jupyter Server并执行 - 关闭VSCode,删除用户目录下的
.jupyter文件夹(路径:C:\Users\Theodore\.jupyter) - 重新启动VSCode,尝试重新连接内核
- 打开VSCode,按
内容的提问来源于stack exchange,提问作者Theodore Maximus
相关产品推荐
相关产品推荐

