# Error "Package does not have LinearAlgebra in its dependencies" running \`Pkg.test\`

**URL:** <https://discourse.julialang.org/t/error-package-does-not-have-linearalgebra-in-its-dependencies-running-pkg-test/29763>\
**Category:** General Usage\
**Tags:** package, testing, first-steps\
**Created:** [October 11, 2019, 3:31am UTC](https://discourse.julialang.org/t/error-package-does-not-have-linearalgebra-in-its-dependencies-running-pkg-test/29763 "2019-10-11T03:31:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![riccardomurri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/riccardomurri/32/8002_2.png) [@riccardomurri](https://discourse.julialang.org/u/riccardomurri)\
**Post date:** [October 11, 2019, 3:31am UTC](https://discourse.julialang.org/t/error-package-does-not-have-linearalgebra-in-its-dependencies-running-pkg-test/29763/1 "2019-10-11T03:31:53Z")

</div>

Hello!

I am trying to write my first Julia package (called “BEAM”), but keep getting an error when I run `Pkg.test("BEAM")`:

```julia
(BEAM) pkg> test BEAM
   Testing BEAM
 Resolving package versions...
ERROR: LoadError: ArgumentError: Package BEAM does not have LinearAlgebra in its dependencies:
- If you have BEAM checked out for development and have
  added LinearAlgebra 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 BEAM
Stacktrace:

```

Now, as I understand it, `LinearAlgebra` is part of the std library, so why is `Pkg.test` complaining?  
Or, how do I add std library packages to the `[deps]` section of `Project.toml`?

Calling `Pkg.resolve` doesn’t do much:

```julia
(BEAM) pkg> resolve
 Resolving package versions...
  Updating `~/w/BEAM/Project.toml`
 [no changes]
  Updating `~/w/BEAM/Manifest.toml`
 [no changes]

```

I’m using Julia 1.2.0. This is the list of `using` statements from the package sources:

```julia
using FileIO
using Images: Gray;
using IterTools: ivec;
using LinearAlgebra;
using SparseArrays: sparse;

# solver interface
using Convex: Variable, minimize, solve!;
using SCS: SCSSolver;

```

and this is the `[deps]` section from `Project.toml`:

```julia
[deps]
Convex = "f65535da-76fb-5f13-bab9-19810c17039a"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
SCS = "c946c3f1-0d1f-5ce8-9dea-7daa1f7e2d13"

```

Thanks for any explanation!

R

---

<div class="post-metadata">

**Author:** ![zaki](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zaki/32/10300_2.png) [@zaki](https://discourse.julialang.org/u/zaki)\
**Post date:** [October 11, 2019, 4:36am UTC](https://discourse.julialang.org/t/error-package-does-not-have-linearalgebra-in-its-dependencies-running-pkg-test/29763/2 "2019-10-11T04:36:53Z")

</div>

Running

```julia
(BEAM) Pkg> add LinearAlgebra

```

should do the trick.  
Maybe `SparseArrays` would have to be added as well.

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [October 11, 2019, 5:19am UTC](https://discourse.julialang.org/t/error-package-does-not-have-linearalgebra-in-its-dependencies-running-pkg-test/29763/3 "2019-10-11T05:19:01Z")

</div>

> [@riccardomurri](#):
>
> `LinearAlgebra` is part of the std library

Yes, so there’s no need to download it, but you still need to list the dependency (as of Julia 0.7).

---

<div class="post-metadata">

**Author:** ![riccardomurri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/riccardomurri/32/8002_2.png) [@riccardomurri](https://discourse.julialang.org/u/riccardomurri)\
**Post date:** [October 13, 2019, 9:38pm UTC](https://discourse.julialang.org/t/error-package-does-not-have-linearalgebra-in-its-dependencies-running-pkg-test/29763/4 "2019-10-13T21:38:49Z")

</div>

> Running
> 
> ```julia
> (BEAM) Pkg> add LinearAlgebra
> 
> ```
> 
> should do the trick.

Many thanks, it actually did!

(I am sure I had tried it before posting, but for some reason, `LinearAlgebra` was not added to `Project.toml`. Somehow, my REPL must’ve ended up in an inconsistent state; quitting and starting a new session could have fixed it?)
