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

Jupyter Book的MyBinder启动按钮路径错误问题求助

解决Jupyter Book的MyBinder启动按钮路径错误问题

问题场景

在GitHub Pages发布带有MyBinder启动按钮的Jupyter Book时,使用以下_config.yml配置:

launch_buttons:
    notebook_interface: "jupyterlab"
    binderhub_url: "https://mybinder.org"

通过命令构建并部署:

jupyter-book build <directory>
ghp_import -n -p -f _build/html

点击MyBinder启动按钮时,出现路径错误提示:

Cannot open
Could not find path: docs/<file_name>.ipynb
Dismiss

需求是让MyBinder直接从GitHub仓库主分支的根目录启动目标.ipynb文件。

解决方案

在_config.yml的launch_buttons下添加binder_repo_root配置项,指定仓库根目录作为Notebook的来源路径:

launch_buttons:
    notebook_interface: "jupyterlab"
    binderhub_url: "https://mybinder.org"
    binder_repo_root: "."

该配置会覆盖默认的路径规则,让生成的MyBinder链接直接指向仓库主分支的根目录,从而正确找到根目录下的目标.ipynb文件。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.08 04:24:50