# ERROR: UndefVarError: eigvecs not defined

**URL:** <https://discourse.julialang.org/t/error-undefvarerror-eigvecs-not-defined/14923>\
**Category:** New to Julia\
**Created:** [September 13, 2018, 9:42pm UTC](https://discourse.julialang.org/t/error-undefvarerror-eigvecs-not-defined/14923 "2018-09-13T21:42:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [September 13, 2018, 9:42pm UTC](https://discourse.julialang.org/t/error-undefvarerror-eigvecs-not-defined/14923/1 "2018-09-13T21:42:30Z")

</div>

I am trying to follow the examples of the linear algebra documentation:

[https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#Linear-Algebra-1](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#Linear-Algebra-1)

But when I try to compute the eigenvalues or eigenvectors I get:

ERROR: UndefVarError: eigvecs not defined

I am literally copying and pasting the example into the REPL, so either there it is not clear that some package must be loaded before using these functions, or there is a bug. I am using v1.0

Thank you very much.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [September 13, 2018, 9:48pm UTC](https://discourse.julialang.org/t/error-undefvarerror-eigvecs-not-defined/14923/2 "2018-09-13T21:48:02Z")

</div>

It is a stdlib so `using LinearAlgebra` is first needed. Perhaps that should be more explicit.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [September 14, 2018, 11:37am UTC](https://discourse.julialang.org/t/error-undefvarerror-eigvecs-not-defined/14923/3 "2018-09-14T11:37:55Z")

</div>

Thanks Kristoffer. That was indeed the problem.

For newbies like me facing this question: add

using LinearAlgebra

to the code.

I remark that the manual is not clear on that. It says that Julia provides native implementations of many linear algebra functions, and exemplifies with tr(A), det(A), which work out of the box, and then exemplifies with eigvals(A), eigvecs(A), which result in that error.

In other words, it is just that the manual is not clear in the sense that it suggests that the functions are usable out of the box, and does not indicate that a package must be used, and which is the name of the package.

To be clear, I am referring to this page:

[https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#Linear-Algebra-1](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#Linear-Algebra-1)

Thank you very much again.

---

<div class="post-metadata">

**Author:** ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Post date:** [September 14, 2018, 5:20pm UTC](https://discourse.julialang.org/t/error-undefvarerror-eigvecs-not-defined/14923/4 "2018-09-14T17:20:16Z")

</div>

I made a PR to the docs: [Make `using LinearAlgebra` explicit by stillyslalom · Pull Request #29188 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/29188)
