It is best to use the built-in package management, then you just need to import / using external packages. Pluto automatically pins the versions for reproducibility.
You only need to manage Pkg environments on your own if you are using unregistered packages, local dev packages or specific package git branches. Instructions for these cases are given in the link posted by @disberd .
@lungben It would be nice to do that, however every time I start Pluto, it offers me to install everything, rather then using the local Project.toml. Is there anyway to use Pluto’s own package manager on already defined Project.toml
The built-in package manager has the Project.toml and Manifest.toml integrated in the notebook.jl file. If the packages are already installed, Pluto does not re-install them, analogue to activating a Project.toml file (what is actually done under the hood).
To use an external Project.toml file see here: 🎁 Package management · fonsp/Pluto.jl Wiki · GitHub
Combining both approaches is not possible because it would be ambiguous.
Totally agree with the great advice given above. I also like using:
(included in the “shared environment” link @lungben shared above) if my notebooks are deeper down and I don’t want to manually keep track of how many ../../ I need to do. It’s my understanding that it has the same behavior as --project=@., which is super handy!
Ah OK I see what’s wrong. My package name is Analyzer while in src I have multiple files, Analyzer.jl, Db.jl etc. So import Analyzer works while import Db doesn’t. Same in your project. If I add src/Db2.jl then using Db2 won’t work.