Stop Pluto from Precompiling

I would like to stop Pluto from precompiling packages when they are added to the environment. I think normally this can be done with compiled-modules=no. Is it also possible to disable this in a pluto notebook?
I think this would be very helpful for me, as much more time is spent on precompilation than on execution for this interactive usecase.

From the Pluto documentation:

When adding a package to your notebook, Pluto will ask Pkg to install a version that was previously downloaded on your computer. This was added in May 2024, on older versions, Pkg would always try to install the newest versions.

This should make it much faster to open a notebook and import some packages that you already used recently. If you need the latest versions, then you have to use the Update button after adding the packages.

So check if your Pluto.jl version is latest first.

Otherwise, does this documentation on using local environments in Pluto notebooks help? It disables reproducibility but might help you do what you want.

What’s your use case? Are you doing something like comparing different package behaviours independent of each other? Or demonstrating adding and removing packages?

Yes, I am using the latest version v0.19.45 .

I noticed that after I open a notebook that I previously worked on, pluto always opens in in preview mode. Then when I execute code pluto always precompiles all the imported packaged (ModellingToolkit can take a long time). Even though I already have the packaged eg. ModellingToolkit in my systemwide packages.

So this feature does not really seem to work apparently, therefore I would like to rather not precompile anything at all.

Yeah ModelingToolkit has had a history of not working well on Pluto notebooks for a while. I think it keeps cycling between working and not working, in my experience. The main problem I’ve found from reading around and experience is macros in Pluto don’t normally play well. So for the time being, you may want to use the non-DSL API of MTK.

As for compile time, I also tend to get a similar experience where Pluto keeps recompiling something I know I’ve already recompiled. A workaround might be a finer control of the Pluto environment which removes reproducibility as a trade-off.

I do imagine these issues will be fixed in the future, the value of something like MTK in Pluto is quite high. But given the ongoing development of MTK (though somewhat stabilising recently as far as I’ve seen), it might be a while.

1 Like

Hey! Most flags from Command-line Interface · The Julia Language are also available in Pluto, just replace - with _:

Pluto.run(compiled_modules="no", pkgimages="no")
2 Likes

You can find all available options in our new docs:

2 Likes