fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.91k stars 284 forks source link

CondaPkg environments are re-resolved each time a Pluto notebook is opened #2883

Open stillyslalom opened 3 months ago

stillyslalom commented 3 months ago
  1. Video: Animation
  2. Gist: https://gist.github.com/stillyslalom/fcc3e5342244f097d42fa81f72f0b817
  3. Because Pluto creates a new temporary environment each time a notebook is executed, any Conda environment required by the notebook has to be re-resolved each time. Even with all Conda packages cached, this is a fairly slow process - it takes about a minute for my package PyThermo.jl to re-load in an existing Pluto notebook, versus about 10 seconds in the REPL. Other CondaPkg users have encountered the same issue (https://github.com/JuliaPy/CondaPkg.jl/issues/120), but it appears the problem needs to be resolved from the Pluto side.
fonsp commented 2 months ago

Hey! Thanks for bringing this up, I would like this to work better!

Can you take a look at previous discussion in https://github.com/JuliaPy/PythonCall.jl/issues/102 ?

In particular, I wonder if this would be fixed by storing the contents of CondaPkg.toml in the notebook, just like Project.toml and Manifest.toml, like I suggested in my issue.

Can you check this? To reproduce: make an empty folder called myenv and activate it and set up PyThermo.

  1. Copy myenv and call it myenv2, and remove the CondaPkg.toml file. Measure how long this env takes to start. This should match what Pluto does.
  2. Copy myenv and call it myenv3, and keep the CondaPkg.toml file. Measure how long this env takes to start.