# Using ShareAdd.jl in Pluto.jl

**URL:** <https://discourse.julialang.org/t/using-shareadd-jl-in-pluto-jl/134382>\
**Category:** Pluto\
**Created:** [December 5, 2025, 4:10pm UTC](https://discourse.julialang.org/t/using-shareadd-jl-in-pluto-jl/134382 "2025-12-05T16:10:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maucejo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maucejo/32/39090_2.png) [@Maucejo](https://discourse.julialang.org/u/Maucejo)\
**Post date:** [December 5, 2025, 4:10pm UTC](https://discourse.julialang.org/t/using-shareadd-jl-in-pluto-jl/134382/1 "2025-12-05T16:10:24Z")

</div>

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

```julia
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:

```julia
begin
	x = 1:10
    lines(x, x)
end

```

The error message is:

```julia
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?

Thank you

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [December 5, 2025, 4:20pm UTC](https://discourse.julialang.org/t/using-shareadd-jl-in-pluto-jl/134382/2 "2025-12-05T16:20:49Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![Maucejo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maucejo/32/39090_2.png) [@Maucejo](https://discourse.julialang.org/u/Maucejo)\
**Post date:** [December 5, 2025, 5:16pm UTC](https://discourse.julialang.org/t/using-shareadd-jl-in-pluto-jl/134382/3 "2025-12-05T17:16:53Z")

</div>

I don’t use Pluto builtin environment manager because I use local packages that are not registered.

---

<div class="post-metadata">

**Author:** ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Post date:** [December 5, 2025, 5:45pm UTC](https://discourse.julialang.org/t/using-shareadd-jl-in-pluto-jl/134382/4 "2025-12-05T17:45:00Z")

</div>

Here the author of ShareAdd.jl, who has never used Pluto, and not really used Jupiter, too.

What would happen if you do:

```julia-auto
using ShareAdd
@usingany CairoMakie
using CairoMakie
# some Makie function in the same cell

```

and if works, call some Makie function in another cell

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [December 5, 2025, 6:20pm UTC](https://discourse.julialang.org/t/using-shareadd-jl-in-pluto-jl/134382/5 "2025-12-05T18:20:18Z")

</div>

> [@Maucejo](#):
>
> I don’t use Pluto builtin environment manager because I use local packages that are not registered.

You might consider LocalRegistry.jl – it’s very straightforward, and a great fit for this exact scenario.

---

<div class="post-metadata">

**Author:** ![Maucejo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maucejo/32/39090_2.png) [@Maucejo](https://discourse.julialang.org/u/Maucejo)\
**Post date:** [December 5, 2025, 6:23pm UTC](https://discourse.julialang.org/t/using-shareadd-jl-in-pluto-jl/134382/6 "2025-12-05T18:23:27Z")

</div>

Thanks @Eben60. It works. But may I ask, why did you think that it might work ?

---

<div class="post-metadata">

**Author:** ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Post date:** [December 5, 2025, 6:37pm UTC](https://discourse.julialang.org/t/using-shareadd-jl-in-pluto-jl/134382/7 "2025-12-05T18:37:22Z")

</div>

> [@Eben60](#):
>
> `@usingany`

`@usingany` should

- make the environment containing the package called available by adding it to `LOAD_PATH`, and
- then execute the `using` statement.

For whatever reason it didn’t work properly, but as you wrote:

> [@Maucejo](#):
>
> I understand that CairoMakie is loaded but not imported in Main.

I guessed the first part executed OK, and then manual import could be possible. Which then worked.
