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

Posit Workbench启动Jupyter Notebook时报错:找不到jupyter_core.command模块

解决Posit Workbench中Jupyter Notebook启动报错问题

问题详情

  • 操作系统:RHL9
  • Posit Workbench:已按官方步骤完成安装,无报错
  • Python环境路径:/opt/python/3.11.5/bin/
  • 触发场景:尝试启动Jupyter Notebook会话时抛出错误:
Traceback (most recent call last):
File "/opt/python/3.11.5/bin/jupyter", line 5, in <module>
from jupyter_core.command import main
ModuleNotFoundError: No module named 'jupyter_core.command'
  • 异常矛盾点:执行/opt/python/3.11.5/bin/jupyter --version,输出显示jupyter_core已安装(版本5.7.1):
IPython : 8.21.0
ipykernel : 6.29.2
ipywidgets : 8.1.2
jupyter_client : 7.4.9
jupyter_core : 5.7.1
jupyter_server : 1.24.0
jupyterlab : 3.6.5
nbclient : 0.9.0
nbconvert : 7.16.0
nbformat : 5.9.2
notebook : 6.5.6
qtconsole : 5.5.1
traitlets : 5.14.1

可行解决步骤

  • 强制重新安装匹配版本的jupyter_core,确保安装路径与当前Python环境绑定:
    /opt/python/3.11.5/bin/pip install --force-reinstall jupyter_core==5.7.1
    
  • 检查jupyter启动脚本的有效性:
    打开/opt/python/3.11.5/bin/jupyter文件,确认首行shebang为#!/opt/python/3.11.5/bin/python,且from jupyter_core.command import main语句无拼写错误
  • 验证Posit Workbench的环境配置:
    在Workbench管理界面中确认指定的Python解释器路径为/opt/python/3.11.5/bin/python,避免环境变量冲突导致加载错误的模块路径

内容的提问来源于stack exchange,提问作者Daniel Castro

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.29 19:42:09