# New to managing package dependencies and environments

**URL:** https://discourse.julialang.org/t/new-to-managing-package-dependencies-and-environments/111837
**Category:** New to Julia
**Tags:** question, package, makie
**Created:** [March 19, 2024, 6:40pm UTC](https://discourse.julialang.org/t/new-to-managing-package-dependencies-and-environments/111837 "2024-03-19T18:40:48Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Niall](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/niall/32/22517_2.png) [@Niall](https://discourse.julialang.org/u/Niall)
#### Post date: [March 19, 2024, 6:40pm UTC](https://discourse.julialang.org/t/new-to-managing-package-dependencies-and-environments/111837/1 "2024-03-19T18:40:48Z")

</div>

Hi. I don’t really understand very well how to set up the project.toml file for my package - in particular I don’t understand how to set up package dependencies or use environments. So I have two questions. First, can anyone tell me how to fix the following dependencies problem (see below), and second, where can I find a Packages for Dummies reference to read up on all this?  
Thanks!

```julia
ERROR: LoadError: The following 2 direct dependencies failed to precompile:

DynamicalSystems --code-coverage=@/home/runner/work/Anatta.jl/Anatta.jl --color=yes --check-bounds=yes --warn-overwrite=yes --depwarn=yes --inline=yes --startup-file=no --track-allocation=none --check-bounds=yes 

Failed to precompile DynamicalSystems [61744808-ddfa-5f27-97ff-6e42cc95d634] to "/home/runner/.julia/compiled/v1.12/DynamicalSystems/jl_JB8saP".

GLMakie --code-coverage=@/home/runner/work/Anatta.jl/Anatta.jl --color=yes --check-bounds=yes --warn-overwrite=yes --depwarn=yes --inline=yes --startup-file=no --track-allocation=none --check-bounds=yes 

Failed to precompile GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a] to "/home/runner/.julia/compiled/v1.12/GLMakie/jl_jKz8OM".

Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] precompilepkgs(pkgs::Vector{String}; internal_call::Bool, strict::Bool, warn_loaded::Bool, timing::Bool, _from_loading::Bool, configs::Pair{Cmd, Base.CacheFlags}, io::IOContext{Base.PipeEndpoint}, fancyprint::Bool)
    @ Base.Precompilation ./precompilation.jl:372
  [3] (::Pkg.API.var"#227#228"{Bool, Bool, Bool, Bool, Bool, Pair{Cmd, Base.CacheFlags}, Vector{Pkg.Types.PackageSpec}})()
    @ Pkg.API /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/API.jl:1158
  [4] activate(f::Pkg.API.var"#227#228"{Bool, Bool, Bool, Bool, Bool, Pair{Cmd, Base.CacheFlags}, Vector{Pkg.Types.PackageSpec}}, new_project::String)
    @ Pkg.API /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/API.jl:1379
  [5] precompile(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, _from_loading::Bool, configs::Pair{Cmd, Base.CacheFlags}, kwargs::@Kwargs{io::Pkg.UnstableIO})
    @ Pkg.API /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/API.jl:1156
  [6] precompile
    @ /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/API.jl:1132 [inlined]
  [7] #precompile#118
    @ /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/API.jl:164 [inlined]
  [8] (::Pkg.Operations.var"#132#137"{Base.CacheFlags, Cmd, Pkg.Types.Context})()
    @ Pkg.Operations /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:2049
  [9] activate(f::Pkg.Operations.var"#132#137"{Base.CacheFlags, Cmd, Pkg.Types.Context}, new_project::String)
    @ Pkg.API /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/API.jl:1379
 [10] (::Pkg.Operations.var"#131#136"{Bool, Cmd, Cmd, Nothing, Pkg.Types.Context, Vector{Tuple{String, Base.Process}}, String, Pkg.Types.PackageSpec})()
    @ Pkg.Operations /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:2048
 [11] withenv(::Pkg.Operations.var"#131#136"{Bool, Cmd, Cmd, Nothing, Pkg.Types.Context, Vector{Tuple{String, Base.Process}}, String, Pkg.Types.PackageSpec}, ::Pair{String, String}, ::Vararg{Pair{String}})
    @ Base ./env.jl:265
 [12] macro expansion
    @ ./logging.jl:113 [inlined]
 [13] (::Pkg.Operations.var"#118#123"{String, Pkg.Types.EnvCache, Bool, Bool, Bool, Pkg.Operations.var"#131#136"{Bool, Cmd, Cmd, Nothing, Pkg.Types.Context, Vector{Tuple{String, Base.Process}}, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec})()
    @ Pkg.Operations /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:1896
 [14] with_temp_env(fn::Pkg.Operations.var"#118#123"{String, Pkg.Types.EnvCache, Bool, Bool, Bool, Pkg.Operations.var"#131#136"{Bool, Cmd, Cmd, Nothing, Pkg.Types.Context, Vector{Tuple{String, Base.Process}}, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec}, temp_env::String)
    @ Pkg.Operations /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:1766
 [15] (::Pkg.Operations.var"#116#121"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#131#136"{Bool, Cmd, Cmd, Nothing, Pkg.Types.Context, Vector{Tuple{String, Base.Process}}, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, String})(tmp::String)
    @ Pkg.Operations /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:1837
 [16] mktempdir(fn::Pkg.Operations.var"#116#121"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#131#136"{Bool, Cmd, Cmd, Nothing, Pkg.Types.Context, Vector{Tuple{String, Base.Process}}, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, String}, parent::String; prefix::String)
    @ Base.Filesystem ./file.jl:835
 [17] mktempdir(fn::Function, parent::String)
    @ Base.Filesystem ./file.jl:831
 [18] mktempdir
    @ ./file.jl:831 [inlined]
 [19] #sandbox#115
    @ /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:1822 [inlined]
 [20] NamedTuple
    @ ./boot.jl:749 [inlined]
 [21] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage::Bool, julia_args::Cmd, test_args::Cmd, test_fn::Nothing, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
    @ Pkg.Operations /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:2040
 [22] test
    @ /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:1984 [inlined]
 [23] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage::Bool, test_fn::Nothing, julia_args::Vector{String}, test_args::Cmd, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool, kwargs::@Kwargs{io::Pkg.UnstableIO})
    @ Pkg.API /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/API.jl:475
 [24] test(pkgs::Vector{Pkg.Types.PackageSpec}; io::Pkg.UnstableIO, kwargs::@Kwargs{coverage::Bool, julia_args::Vector{String}, force_latest_compatible_version::Bool})
    @ Pkg.API /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/API.jl:159
 [25] test(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::@Kwargs{coverage::Bool, julia_args::Vector{String}, force_latest_compatible_version::Bool})
    @ Pkg.API /opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.12/Pkg/src/API.jl:174
 [26] top-level scope
    @ ~/work/_actions/julia-actions/julia-runtest/latest/test_harness.jl:15
 [27] include(fname::String)
    @ Main ./sysimg.jl:38
 [28] top-level scope
    @ none:1
in expression starting at /home/runner/work/_actions/julia-actions/julia-runtest/latest/test_harness.jl:7
Error: Process completed with exit code 1.

```

---

<div class="post-metadata">

### Author: ![Nathan\_Boyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nathan_boyer/32/14825_2.png) [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)
#### Post date: [March 19, 2024, 7:38pm UTC](https://discourse.julialang.org/t/new-to-managing-package-dependencies-and-environments/111837/2 "2024-03-19T19:38:38Z")

</div>

The toml files will be set up for you by the package manager (except for optional but recommended dependency compatibility bounds). Once you `generate` a package and `activate` it as the current environment, then packages you `add` to that environment will automatically become dependencies of your package.

More info in the links below:

[Writing your code (modernjuliaworkflows.github.io)](https://modernjuliaworkflows.github.io/writing/#environments)

[jkrumbiegel.com - Pkg.jl and Julia Environments for Beginners](https://jkrumbiegel.com/pages/2022-08-26-pkg-introduction/)

[5. Creating Packages · Pkg.jl (julialang.org)](https://pkgdocs.julialang.org/v1/creating-packages/)

---

<div class="post-metadata">

### Author: ![Niall](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/niall/32/22517_2.png) [@Niall](https://discourse.julialang.org/u/Niall)
#### Post date: [March 20, 2024, 9:34am UTC](https://discourse.julialang.org/t/new-to-managing-package-dependencies-and-environments/111837/3 "2024-03-20T09:34:48Z")

</div>

Thanks very much, @Nathan_Boyer - that’s really useful information. I’m still struggling to understand where to start with solving the precompilation problems of GLMakie and DynamicalSystems. If it helps, their compatibilities are:

```julia
Agents = "5.8.0, 6"
CSV = "0.10"
DataFrames = "1.5.0"
DynamicalSystems = "3.0.0"
GLMakie = "0.8.2, 0.9"
InteractiveDynamics = "0.22"
Makie = "0.19.2, 0.20"
Observables = "0.5.4"
Statistics = "1"
julia = "1.6"

```

---

<div class="post-metadata">

### Author: ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)
#### Post date: [March 20, 2024, 9:50am UTC](https://discourse.julialang.org/t/new-to-managing-package-dependencies-and-environments/111837/4 "2024-03-20T09:50:29Z")

</div>

I notice the error message says Julia 1.12. Why are you running the nightly version? Use Julia 1.10.2.

---

<div class="post-metadata">

### Author: ![Niall](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/niall/32/22517_2.png) [@Niall](https://discourse.julialang.org/u/Niall)
#### Post date: [March 20, 2024, 11:27am UTC](https://discourse.julialang.org/t/new-to-managing-package-dependencies-and-environments/111837/5 "2024-03-20T11:27:28Z")

</div>

Thanks. So if I understand you rightly, I should either remove the nightly run or change it to use version 1.10.2, yes? How would I do either of those? So far, I’ve just let github do whatever it throught best. 🫤

---

<div class="post-metadata">

### Author: ![Niall](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/niall/32/22517_2.png) [@Niall](https://discourse.julialang.org/u/Niall)
#### Post date: [March 20, 2024, 11:55am UTC](https://discourse.julialang.org/t/new-to-managing-package-dependencies-and-environments/111837/6 "2024-03-20T11:55:29Z")

</div>

OK, got it! I removed the nightly run from CI.yml. But I really must start trying to understand all this job control stuff better. Thanks for your help! 😃

---

<div class="post-metadata">

### Author: ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)
#### Post date: [March 20, 2024, 1:17pm UTC](https://discourse.julialang.org/t/new-to-managing-package-dependencies-and-environments/111837/7 "2024-03-20T13:17:30Z")

</div>

Oh, I did not know this is for continuous integration. For a packge of this complexity, it might be some time before Julia nightly is fully compatible with these packages. It’s not a bad idea to add an optional test for this though.

---

<div class="post-metadata">

### Author: ![Niall](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/niall/32/22517_2.png) [@Niall](https://discourse.julialang.org/u/Niall)
#### Post date: [March 21, 2024, 10:04am UTC](https://discourse.julialang.org/t/new-to-managing-package-dependencies-and-environments/111837/8 "2024-03-21T10:04:57Z")

</div>

You know, as a beginner - and maybe even more so as someone who is knowledgeable in one area and not in another - it’s not easy to come out and tell others what one doesn’t understand. Because of this, I just love the friendly, helpful and thoughtful atmosphere here on the julia discourse forum. Thank-you very much! 😃

---

<div class="post-metadata">

### Author: ![Niall](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/niall/32/22517_2.png) [@Niall](https://discourse.julialang.org/u/Niall)
#### Post date: [October 12, 2024, 1:26pm UTC](https://discourse.julialang.org/t/new-to-managing-package-dependencies-and-environments/111837/9 "2024-10-12T13:26:31Z")

</div>

I’m having the same problem again: On 6th October I created a new release of the [Anatta](https://github.com/NiallPalfreyman/Anatta.jl) package and the compile and release process went through smoothly. Then, on 9th and 10th October, I pushed a couple of small code changes with no new dependencies, and both times got the following fail message:

```julia
The following actions use a deprecated Node.js version and will be forced to run on node20

```

I assume this relates to a change in some dependency package outside my control, but I don’t understand enough about workflows to get around it. Can anyone help?

---

<div class="post-metadata">

### Author: ![JoshuaLampert](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshualampert/32/205964_2.png) [@JoshuaLampert](https://discourse.julialang.org/u/JoshuaLampert)
#### Post date: [October 12, 2024, 4:04pm UTC](https://discourse.julialang.org/t/new-to-managing-package-dependencies-and-environments/111837/10 "2024-10-12T16:04:01Z")

</div>

I believe this message

```julia
The following actions use a deprecated Node.js version and will be forced to run on node20

```

is not the cause of your failing CI, but rather a warning. In order to fix this warning, you will need to replace [this line in your CI workflow](https://github.com/NiallPalfreyman/Anatta.jl/blob/14ed2afa6e7fa7adf43e1ac93114123319f702a8/.github/workflows/CI.yml#L32) by

```julia
      - uses: julia-actions/cache@v2

```

Regarding the [error in your CI run](https://github.com/NiallPalfreyman/Anatta.jl/actions/runs/11253028956/job/31287435888#step:6:946), I suspect I can’t help.

---

<div class="post-metadata">

### Author: ![Niall](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/niall/32/22517_2.png) [@Niall](https://discourse.julialang.org/u/Niall)
#### Post date: [October 13, 2024, 11:22am UTC](https://discourse.julialang.org/t/new-to-managing-package-dependencies-and-environments/111837/11 "2024-10-13T11:22:59Z")

</div>

Absolutely correct - thank you very much. I’ll need to check with Makie.  
Best wishes,  
Niall.
