Hi all, I use ShareAdd.jl to manage my shared environments. I also generally use @usingany to use a package without installing it in a project environment (which is very convenient).
However, I tried to use ShareAdd inside a Pluto notebook. In the first cell of the notebook, I import all my packages like
begin
using Pkg
Pkg.activate("../.")
using ShareAdd
@usingany CairoMakie
end
The cell is executed without error. Unfortunately, when I call a CairoMakie function in another cell, Pluto throws an errors:
begin
x = 1:10
lines(x, x)
end
The error message is:
UndefVarError: lines not defined in this notebook.
Suggestion: check for spelling errors or missing imports.
Hint: a global variable of this name also exists in Contour.
Hint: a global variable of this name also exists in Makie.
- Also exported by CairoMakie (loaded but not imported in Main).
From the error message, I understand that CairoMakie is loaded but not imported in Main. Do you have any advice to solve this issue?
Don’t know about @usingany in Pluto, but is there any specific reason you don’t use Pluto’s builtin environment manager? No need to manually install packages into any env then – your whole cell shortens to just using CairoMakie.