# Not easy to add utility packages to env

**URL:** https://discourse.julialang.org/t/not-easy-to-add-utility-packages-to-env/93068
**Category:** Performance
**Tags:** package-manager
**Created:** [January 17, 2023, 5:25am UTC](https://discourse.julialang.org/t/not-easy-to-add-utility-packages-to-env/93068 "2023-01-17T05:25:03Z")
**Posts on this page:** 3
**Page:** 2

<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: [January 17, 2023, 8:57pm UTC](https://discourse.julialang.org/t/not-easy-to-add-utility-packages-to-env/93068/21 "2023-01-17T20:57:18Z")

</div>

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
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!

```

---

<div class="post-metadata">

### Author: ![merlin](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@merlin](https://discourse.julialang.org/u/merlin)
#### Post date: [January 17, 2023, 9:27pm UTC](https://discourse.julialang.org/t/not-easy-to-add-utility-packages-to-env/93068/22 "2023-01-17T21:27:48Z")

</div>

Excellent point here. In my own use case, the global packages are not dependencies of the package I’m working on, they are only convenience for debugging, data exploration, etc.

In this workflow, global package compatibility wont affect the deployed package.

---

<div class="post-metadata">

### Author: ![tictaccat](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@tictaccat](https://discourse.julialang.org/u/tictaccat)
#### Post date: [January 18, 2023, 6:32am UTC](https://discourse.julialang.org/t/not-easy-to-add-utility-packages-to-env/93068/23 "2023-01-18T06:32:10Z")

</div>

The issues with stacking environments is what I was trying to avoid with my `add --copy @utils` suggestion earlier. Something that has 90% of the convenience of stacking a group of packages into your current env (whether a temporary one, in a debug folder, etc.) but without the reproducibiilty dangers.

[Previous page](https://discourse.julialang.org/t/not-easy-to-add-utility-packages-to-env/93068.md?page=1)
