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

Hello!

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

(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:

(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:

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:

[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

Running

(BEAM) Pkg> add LinearAlgebra

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

4 Likes

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

2 Likes

Running

(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?)