# Best environment practice when working on a package

**URL:** <https://discourse.julialang.org/t/best-environment-practice-when-working-on-a-package/137003>\
**Category:** General Usage\
**Created:** [May 6, 2026, 11:29am UTC](https://discourse.julialang.org/t/best-environment-practice-when-working-on-a-package/137003 "2026-05-06T11:29:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niclas\_Wiberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/niclas_wiberg/32/19063_2.png) [@Niclas\_Wiberg](https://discourse.julialang.org/u/Niclas_Wiberg)\
**Post date:** [May 6, 2026, 11:29am UTC](https://discourse.julialang.org/t/best-environment-practice-when-working-on-a-package/137003/1 "2026-05-06T11:29:58Z")

</div>

When working on a package MyPackage, I have so far also used MyPackage as my current environment. This seems to work well, for instance I can easily add package dependencies using ]add.

But sometimes, e.g. during debugging, I may temporarily need a package (e.g. Plots) that I don’t want to add to MyPackage, and also not to my default environment.

What is the best practice for this? Should I have a different environment specifically for the development of MyPackage, and then activate MyPackage only temporarily when working with its dependencies?

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [May 6, 2026, 11:40am UTC](https://discourse.julialang.org/t/best-environment-practice-when-working-on-a-package/137003/2 "2026-05-06T11:40:13Z")

</div>

I personally have an environment, where the package(s) I develop are in development mode, I have revise and other debugging tools installed.

I actually only ever use a packages own environment to add (or remove) dependencies.

So yes, I do exactly as you write, I have a development environment for my package – or more precisely one where all packages from the ecosystem I mostly work on are in dev-mode.

---

<div class="post-metadata">

**Author:** ![gwr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gwr/32/33632_2.png) [@gwr](https://discourse.julialang.org/u/gwr)\
**Post date:** [May 6, 2026, 11:41am UTC](https://discourse.julialang.org/t/best-environment-practice-when-working-on-a-package/137003/3 "2026-05-06T11:41:48Z")

</div>

> **[Development workflow - Writing your code](https://modernjuliaworkflows.org/writing/#development_workflow)**
>
> In this post, you will learn about tools to create, run and debug Julia code.

Additionally, some pointers there.

---

<div class="post-metadata">

**Author:** ![obsidianjulua](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/obsidianjulua/32/221495_2.png) [@obsidianjulua](https://discourse.julialang.org/u/obsidianjulua)\
**Post date:** [May 6, 2026, 11:46am UTC](https://discourse.julialang.org/t/best-environment-practice-when-working-on-a-package/137003/4 "2026-05-06T11:46:16Z")

</div>

Using MyPackage as your only environment or the one you activate, I would suggest putting MyPackage in @MyPackage and then you can install anything to your julia pkgs and include them or call using from the repl while your MyPackage is loaded. Keeps your environment clean and lets you access any features from other pkgs. You can make temp dirs with julia too or if your MyPackage is on git you can dev . your repo as well, you have alot of options for isolating things.

---

<div class="post-metadata">

**Author:** ![LeePhillips](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leephillips/32/205514_2.png) [@LeePhillips](https://discourse.julialang.org/u/LeePhillips)\
**Post date:** [May 6, 2026, 5:57pm UTC](https://discourse.julialang.org/t/best-environment-practice-when-working-on-a-package/137003/5 "2026-05-06T17:57:09Z")

</div>

This is exactly what workspaces are for. They appeared in Julia 1.12: [Julia 1.12 brings progress on standalone binaries and more [LWN.net]](https://lwn.net/Articles/1044280/)

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [May 6, 2026, 8:14pm UTC](https://discourse.julialang.org/t/best-environment-practice-when-working-on-a-package/137003/6 "2026-05-06T20:14:10Z")

</div>

I also am not entirely clear on how to do it best. I make shared environments with development tools, works basically like a default environment but I can make as many for a Julia version as I want. If I activate another environment on top of it, I can load packages from either, with the risk of them disagreeing on a dependency’s version and doing weird things like triggering precompilation for a weird mix of environments ([jkrumbiegel.com – Pkg.jl and Julia Environments for Beginners - Stacked Environments](https://jkrumbiegel.com/pages/2022-08-26-pkg-introduction/#stacked-environments)). Workspaces resolve projects together, but it doesn’t seem right to restrain a project with expendable plotting libraries. Tests and benchmarks, especially across a monorepo, are more justifiable because those validate the behavior of the package in the first place.

---

<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:** [May 8, 2026, 9:50am UTC](https://discourse.julialang.org/t/best-environment-practice-when-working-on-a-package/137003/7 "2026-05-08T09:50:57Z")

</div>

My package, ShareAdd.jl, adds tools to make working with shared/stacked environments more comfortable and now recognizes workspaces, too. With it, importing `Plots` is as easy as calling

```julia-auto
@usingany Plots

```

If `Plots` is available anywhere in a shared environment, this works seamlessly. Otherwise, ShareAdd.jl would install it for you into the environment of your choice.

The problem of precompilation may still occur, of course: stacked environments can trigger invalidations when Julia resolves version conflicts dynamically. The alternative—putting `Plots` into your `MyPackage` directly or having them both in the same workspace—has its own drawbacks, however. In my personal experience, stacked environments with ShareAdd.jl generally work well enough.
