# Stop Pluto from Precompiling

**URL:** <https://discourse.julialang.org/t/stop-pluto-from-precompiling/117364>\
**Category:** Pluto\
**Tags:** question\
**Created:** [July 22, 2024, 8:17pm UTC](https://discourse.julialang.org/t/stop-pluto-from-precompiling/117364 "2024-07-22T20:17:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fourier](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fourier/32/38176_2.png) [@Fourier](https://discourse.julialang.org/u/Fourier)\
**Post date:** [July 22, 2024, 8:17pm UTC](https://discourse.julialang.org/t/stop-pluto-from-precompiling/117364/1 "2024-07-22T20:17:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kapple](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kapple/32/218915_2.png) [@kapple](https://discourse.julialang.org/u/kapple)\
**Post date:** [July 23, 2024, 3:22am UTC](https://discourse.julialang.org/t/stop-pluto-from-precompiling/117364/2 "2024-07-23T03:22:06Z")

</div>

From [the Pluto documentation](https://plutojl.org/en/docs/packages/):

> 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](https://plutojl.org/en/docs/packages-advanced/) 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?

---

<div class="post-metadata">

**Author:** ![Fourier](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fourier/32/38176_2.png) [@Fourier](https://discourse.julialang.org/u/Fourier)\
**Post date:** [July 24, 2024, 1:34pm UTC](https://discourse.julialang.org/t/stop-pluto-from-precompiling/117364/3 "2024-07-24T13:34:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kapple](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kapple/32/218915_2.png) [@kapple](https://discourse.julialang.org/u/kapple)\
**Post date:** [July 24, 2024, 3:29pm UTC](https://discourse.julialang.org/t/stop-pluto-from-precompiling/117364/4 "2024-07-24T15:29:34Z")

</div>

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](https://plutojl.org/en/docs/packages-advanced/) 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.

---

<div class="post-metadata">

**Author:** ![fonsp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fonsp/32/222349_2.png) [@fonsp](https://discourse.julialang.org/u/fonsp)\
**Post date:** [August 11, 2024, 7:02am UTC](https://discourse.julialang.org/t/stop-pluto-from-precompiling/117364/5 "2024-08-11T07:02:53Z")

</div>

Hey! Most flags from [Command-line Interface · The Julia Language](https://docs.julialang.org/en/v1/manual/command-line-interface/) are also available in Pluto, just replace `-` with `_`:

```julia
Pluto.run(compiled_modules="no", pkgimages="no")

```

---

<div class="post-metadata">

**Author:** ![fonsp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fonsp/32/222349_2.png) [@fonsp](https://discourse.julialang.org/u/fonsp)\
**Post date:** [August 11, 2024, 7:06am UTC](https://discourse.julialang.org/t/stop-pluto-from-precompiling/117364/6 "2024-08-11T07:06:11Z")

</div>

You can find all available options in our new docs:

> **[⚙️ Configuring Pluto — Pluto.jl](https://plutojl.org/en/docs/configuration/)**
>
> How to change settings of the Pluto.jl Julia notebook
