# Missing dependencies error in new package

**URL:** <https://discourse.julialang.org/t/missing-dependencies-error-in-new-package/29851>\
**Category:** New to Julia\
**Created:** [October 13, 2019, 6:01am UTC](https://discourse.julialang.org/t/missing-dependencies-error-in-new-package/29851 "2019-10-13T06:01:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpf01](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mpf01/32/8221_2.png) [@mpf01](https://discourse.julialang.org/u/mpf01)\
**Post date:** [October 13, 2019, 6:01am UTC](https://discourse.julialang.org/t/missing-dependencies-error-in-new-package/29851/1 "2019-10-13T06:01:56Z")

</div>

As I develop a new package (initialized using the instructions here [PkgTemplates.jl](https://invenia.github.io/PkgTemplates.jl/stable/), I receive these kinds of warnings:

```julia-repl
julia> using PolarDemixing
[Info: Recompiling stale cache file /Users/mpf/.julia/compiled/v1.2/PolarDemixing/v6QzV.ji for PolarDemixing [e00659c4-439f-45b2-9919-f3776aaaadb4]
┌ Warning: Package PolarDemixing does not have Random in its dependencies:
│ - If you have PolarDemixing checked out for development and have
│ added Random as a dependency but haven't updated your primary
│ environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with PolarDemixing
└ Loading Random into PolarDemixing from project dependency, future warnings for PolarDemixing are suppressed.

```

I can suppress this error by editing `.julia/environments/v1.2/Manifest.toml` and adding `deps = ["LinearAlgebra", "Random"]` under the package name. This is probably not the intended way to add dependencies.

What’s the right approach?

---

<div class="post-metadata">

**Author:** ![zgornel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zgornel/32/217487_2.png) [@zgornel](https://discourse.julialang.org/u/zgornel)\
**Post date:** [October 13, 2019, 6:44am UTC](https://discourse.julialang.org/t/missing-dependencies-error-in-new-package/29851/2 "2019-10-13T06:44:09Z")

</div>

Enter pkg mode `]`, `add Random` (project has to be active)

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [October 13, 2019, 12:59pm UTC](https://discourse.julialang.org/t/missing-dependencies-error-in-new-package/29851/3 "2019-10-13T12:59:33Z")

</div>

Hand editing `Manifest.toml` is not recommended (the edits are anyway overridden next time you `add` a dependency etc.

These [Notes on the Julia language](https://lhendricks.org/julia_notes.pdf) may be helpful to get started with understanding packages.

---

<div class="post-metadata">

**Author:** ![mpf01](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mpf01/32/8221_2.png) [@mpf01](https://discourse.julialang.org/u/mpf01)\
**Post date:** [October 13, 2019, 6:16pm UTC](https://discourse.julialang.org/t/missing-dependencies-error-in-new-package/29851/4 "2019-10-13T18:16:19Z")

</div>

How to you make a project “active”?

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [October 13, 2019, 6:43pm UTC](https://discourse.julialang.org/t/missing-dependencies-error-in-new-package/29851/5 "2019-10-13T18:43:36Z")

</div>

You active with “active .” in pkg mode in the directory of the package.

---

<div class="post-metadata">

**Author:** ![mpf01](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mpf01/32/8221_2.png) [@mpf01](https://discourse.julialang.org/u/mpf01)\
**Post date:** [October 13, 2019, 7:08pm UTC](https://discourse.julialang.org/t/missing-dependencies-error-in-new-package/29851/6 "2019-10-13T19:08:35Z")

</div>

Now I understand the right workflow: activate then add. Thanks to all for pointing the way!
