Why does Pluto crash on loading a certain package?

When I use the Julia REPL or load a regular julia file from the command line, I can do something like using SomePackage and it will load in a matter of seconds if the package is already installed. However, when I launch a Pluto instance then doing the same thing often adds a cloud icon next to the package name (implying that it isn’t actually installed?), and it seems to install a new instance of the package every time to a temporary folder, precompiles it (along with all dependencies) which means anything from several minutes to start a Pluto notebook, to just crashing the computer. I’m certain that I am doing something wrong here; is there a way to allow Pluto access to the packages already installed on my system? Or at least a way to limit memory/CPU usage for a given notebook file? I am using Linux if this is relevant.

The behaviour with which packages cause crashes is inconsistent, so perhaps I have some corrupted install, but I am not sure how to diagnose this without having to delete my whole ~/.julia directory.

Many thanks for any advice!

Are you loading a different version of the package?

As an alternative, you can activate a specific environment such as a shared environment rather than creating an environment within the notebook.

Pluto.jl has its own package management to ensure reproducibility. However you can opt out of this by simply loading Pkg.jl and activating an environment. See here for more info and typical patterns:
https://plutojl.org/en/docs/packages/
https://plutojl.org/en/docs/packages-advanced/

1 Like

I’m not using different versions of packages as far as I’m aware, and everything should be up-to-date as this happens with packages I installed very recently. (side note: for comparison, when I use an interactive session the usual REPL, or Jupyter, the precompilation times are at most seconds, while with the exact same code in Pluto it is over 10 minutes.)

according to Using a particular environment with Pluto, if I want to force my notebook to use the default environment, I need to put it in a specific folder; is there a way to avoid this?

in ~/.julia/environments I have the following directories:

  • __pluto_boot_v2_1.7.3
  • v1.7
  • __pluto_boot_v2_1.9.2
  • v1.9

I think only the last two are relevant here; v1.9 is my default environment. It seems like the pluto environments are also temporary and regenerated at each session? In the “status” tab on pluto, it seems that my projects are each saved in their own arbitrary environment, so the toml files are in (e.g.) /tmp/jl_NhLgbE. Is there any way to change this without losing the nice features of pluto?

I think the safest way would be to use

Pkg.activate("v1.9",shared=true)

This activates v1.9 in .julia/environments like a shared environment.

As for the pluto package manager, this acts on top of standard Pkg, and therefore upon notebook start, it extracts Project.toml and Manifest.toml to a temporary folder and handles them with the standard Pkg functions.