A potentially cleaner workflow is to run this kind of code (like plotting) not in the package environment, but in a totally different one - temporary, if that’s a one-off task.
First, add insert!(LOAD_PATH, 2, mktempdir())
to startup.jl
. I wish this was the default, or at least promoted more!
Then in REPL:
julia> using Plots
│ Package Plots not found, but a package named Plots is available from a registry.
│ Install package?
│ (@v1.8) pkg> add Plots
└ Select environment:
> 1: `/tmp/jl_qN95JI` (/tmp/jl_qN95JI)
2: `~/.julia/environments/v1.8/Project.toml` (@v#.#)
# press enter, Plots are now installed in a temp env
(jl_qN95JI) pkg> dev . # assuming you started REPL in the package directory
julia> using YourPackage
# profit!