Where is package loading disabled in the codebase? #1841
-
A question for the Pluto developers. I'm running the following: using Pluto: Cell, Pluto, Notebook, ServerSession, update_save_run!
function run_notebook!(nb::Notebook, session)
cells = [nb.cells_dict[cell_uuid] for cell_uuid in nb.cell_order]
for cell in cells
update_save_run!(session, nb, cell; run_async=false, save=false)
if cell.errored
body = cell.output.body
msg = body[:msg]
stacktrace = body[:stacktrace]
msg = """
$msg
Details:
$stacktrace
"""
error(msg)
end
end
return nothing
end
session = ServerSession()
session.options.evaluation.workspace_use_distributed = false
nb = Notebook([
Cell("""(using Pkg; Pkg.add("TOML");)"""),
Cell("x = 1")
])
run_notebook!(nb, session)
Normally,
So, I think this is done by |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Do you have a stack trace? Did you set any configurations to different values (like |
Beta Was this translation helpful? Give feedback.
-
For anyone running into this discussion, I've had a talk with Fons and he helped me out. The problem of For the |
Beta Was this translation helpful? Give feedback.
For anyone running into this discussion, I've had a talk with Fons and he helped me out. The problem of
run_notebook!
above is that it runs the cells in the order that they are displayed in the notebook and not in the topological order, so that is asking for trouble basically because Pluto does things like involved macro evaluation and that kind of stuff. Instead, usePlutoRunner.open
. For the immediate error handling thatrun_notebook!
does, an alternative would be to run Pluto async, look for cells going into error status and shutdown the notebook as soon as that happens.For the
use_distributed=false
part. It may is useful for PlutoStaticHTML.jl especially in the context of Documenter.…