I’m getting started with Pluto.jl, my module Tibra.jl uses many external libraries. Pluto is asking me to import them one by one. Is there any way to avoid this?
I ran it from my activated project but all that seems to do is set a relative path as Pluto uses its own julia project.
begin
# Having to reimport all of these even though my notebook code doesn't use them
using Dates
using OrdinaryDiffEq
using Plots
using DSP
using Reexport
include("../src/Tibra.jl")
using .Tibra
end
Per default, Pluto automatically creates a new environment for each notebook and manages package dependencies for you, which is useful for beginners and for sharing notebooks. However, that’s why there is the restriction you face.
To avoid the automatic package managing by Pluto, you can use the advanced package mode by activating your own environment. Then Pluto behaves just like any other Julia environment.
If I read your post correctly, then you are not specifically using the things you write but you need them in your environment (since Tibra uses them?)
If you are in a folder and want to use an environment you could start the cell you wrote with
using Pkg;
Pkg.activate(".")
this deactivates the automatic environment and loads the environment in the current folder you started Pluto from.
edit: Note that this destroys the reproducibility Pluto is aiming for with its automatic way to handle packages, so you can not easily share your notebook (standalone) with someone.