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

如何解决VS Code中Jupyter Notebook模块运行失败及Kernel启动超时问题

解决VS Code Jupyter Notebook内核启动超时(Python 3.12.2)问题
  • 检查端口占用
    打开终端,执行lsof -i :8888(Mac/Linux)或者netstat -ano | findstr :8888(Windows),确认8888端口是否被其他进程占用。如果有,杀掉对应进程后重启内核。

  • 手动指定Jupyter端口
    在VS Code设置中搜索Jupyter: Server Port,手动设置一个不常用端口(比如9000),保存后重启VS Code再尝试启动内核。

  • 更新Jupyter相关依赖
    激活Python 3.12.2环境,执行pip install --upgrade jupyter ipykernel ipython,更新内核及Jupyter核心组件,修复可能的版本兼容问题。

  • 重新注册内核
    执行python -m ipykernel install --user --name=python312,重新注册Python 3.12.2内核,之后在VS Code中切换到这个新内核尝试运行代码。

  • 确保pandas安装正常
    在当前环境执行pip install pandas完成安装;若已安装,可执行pip install --force-reinstall pandas重置安装,避免损坏的安装文件导致问题。

  • 查看日志定位深层问题
    打开VS Code命令面板(Ctrl+Shift+P),输入Jupyter: View Logs,查看详细错误日志,排查是否存在环境配置或依赖冲突等深层问题。

内容的提问来源于stack exchange,提问作者Edem Darkey

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.26 15:05:56