# Find packages by function names

**URL:** <https://discourse.julialang.org/t/find-packages-by-function-names/48823>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [October 22, 2020, 2:25pm UTC](https://discourse.julialang.org/t/find-packages-by-function-names/48823 "2020-10-22T14:25:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdemaria](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdemaria/32/18872_2.png) [@rdemaria](https://discourse.julialang.org/u/rdemaria)\
**Post date:** [October 22, 2020, 2:25pm UTC](https://discourse.julialang.org/t/find-packages-by-function-names/48823/1 "2020-10-22T14:25:48Z")

</div>

I am taking my first steps with Julia (using version 1.5), I found a nice package and tried to run an example, which was making use of “norm” and “info”.

These functions are not in the default scope, but probably they were in the past. I googled for “norm” and indeed found it is defined in LinearAlgebra, but I could not find the correct package for “info”.

Is there a general approach to find the packages that define a function with a given name?

Many thanks in advance,  
Riccardo

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [October 22, 2020, 2:39pm UTC](https://discourse.julialang.org/t/find-packages-by-function-names/48823/2 "2020-10-22T14:39:19Z")

</div>

The documentation search on [JuliaHub](https://juliahub.com/ui/Documentation) is pretty useful for this sort of thing, although `info()` is such a generic term that it’s hard to search for. The JuliaHub search does turn up the `Logging.Logging` module in its list, which is the correct answer.

The reason you can’t find `info()` as a package function is that it used to be a built-in function (in Julia 0.6 and earlier) and was replaced with the `@info` macro in Julia 0.7, 1.0, and all following versions. It’s possible that the example you’re following is pretty old (before summer of 2018), since it sounds like it’s using pre-1.0 Julia.

By the way, if you have other code that you want to run which was written pre-Julia 1.0, running it in Julia 0.7 can be very helpful. Julia 0.7 has the same functionality as Julia 1.0, but it also has helpful deprecation warnings for behaviors that were removed before 1.0. For example:

Julia 0.7:

```julia
julia> norm([1,2,3])
WARNING: Base.norm is deprecated: it has been moved to the standard library package `LinearAlgebra`.
Add `using LinearAlgebra` to your imports.
 in module Main
3.7416573867739413

julia> info("hello world")
┌ Warning: `info()` is deprecated, use `@info` instead.
│ caller = top-level scope at none:0
└ @ Core none:0
INFO: hello world

```

---

<div class="post-metadata">

**Author:** ![rdemaria](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdemaria/32/18872_2.png) [@rdemaria](https://discourse.julialang.org/u/rdemaria)\
**Post date:** [October 22, 2020, 2:58pm UTC](https://discourse.julialang.org/t/find-packages-by-function-names/48823/3 "2020-10-22T14:58:17Z")

</div>

Thanks a lot, very insightful! The package was updated for 1.0, but the example in the readme was not.

---

<div class="post-metadata">

**Author:** ![tomerarnon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomerarnon/32/3170_2.png) [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Post date:** [October 22, 2020, 3:37pm UTC](https://discourse.julialang.org/t/find-packages-by-function-names/48823/4 "2020-10-22T15:37:43Z")

</div>

The inverse problem to this, if you have a function already and want to know where it came from, can be solved with `@which`

```julia
julia> @which collect
Base

julia> @which collect(1:10)
collect(r::AbstractRange) in Base at range.jl:997

```

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [October 22, 2020, 4:45pm UTC](https://discourse.julialang.org/t/find-packages-by-function-names/48823/5 "2020-10-22T16:45:58Z")

</div>

Similarly you can also load the package you are using and ask it where it got something from.

Referring to it by qualified name of the scope where you find it.

Say I say `isposdef` being used in the source code of Distributions.jl and i wanted to know where it came from:

```julia
julia> using Distributions

julia> @which Distributions.isposdef
LinearAlgebra

julia> methods(Distributions.isposdef)
# 7 methods for generic function "isposdef":
[1] isposdef(D::LinearAlgebra.Diagonal) in LinearAlgebra at /usr/local/src/julia/julia-1.5/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/diagonal.jl:119
[2] isposdef(A::AbstractArray{T,2} where T) in LinearAlgebra at /usr/local/src/julia/julia-1.5/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/dense.jl:91
[3] isposdef(x::Number) in LinearAlgebra at /usr/local/src/julia/julia-1.5/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/dense.jl:93
[4] isposdef(A::Union{LinearAlgebra.Eigen, LinearAlgebra.GeneralizedEigen}) in LinearAlgebra
 at /usr/local/src/julia/julia-1.5/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/eigen.jl:126
[5] isposdef(C::Union{LinearAlgebra.Cholesky, LinearAlgebra.CholeskyPivoted}) in LinearAlgebra at /usr/local/src/julia/julia-1.5/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/cholesky.jl:551
[6] isposdef(J::LinearAlgebra.UniformScaling) in LinearAlgebra at /usr/local/src/julia/julia-1.5/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/uniformscaling.jl:109
[7] isposdef(F::SuiteSparse.CHOLMOD.Factor) in SuiteSparse.CHOLMOD at /usr/local/src/julia/julia-1.5/usr/share/julia/stdlib/v1.5/SuiteSparse/src/cholmod.jl:1812

```

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 23, 2020, 7:40am UTC](https://discourse.julialang.org/t/find-packages-by-function-names/48823/6 "2020-10-23T07:40:07Z")

</div>

> [@oxinabox](#):
>
> Referring to it by qualified name of the scope where you find it.

```julia
parentmodule(isposdef)

```

is also helpful.
