Skip to content

Notebooks built with --execute can fail (maybe due to session path issues) #2601

@stevejpurves

Description

@stevejpurves

Description

When we run myst start with the execute flag, if we have a notebook in a subfolder that relies on a relative path, the execution od the notebook can fail / produce an error. This can be because the path for the notebook session is not correctly set on execution.

As the same notebook would execute correctly inside of JupyterLab without modification, then we have the expectation that it should also execute correctly when running with via myst build or myst start with the --execute flag.

Image Image

Proposed solution

In live compute mode, the Jupyter package automatically looks for leading path segments to the current notebook and then uses those to set the kernel path appropriately see here, and without that intervention, we would be experiencing the same error in Live Compute, (and have done in the past).

Potentially the solution here is similar?

Additional notes

It's easily reproduced using the https://github.com/jupyter-book/example-outputs site, where the multiple and multiple-nb pages show the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions