# How do I find which module exported a given method or variable?

**URL:** <https://discourse.julialang.org/t/how-do-i-find-which-module-exported-a-given-method-or-variable/49422>\
**Category:** New to Julia\
**Tags:** question, plotting, module, plots\
**Created:** [November 1, 2020, 6:57pm UTC](https://discourse.julialang.org/t/how-do-i-find-which-module-exported-a-given-method-or-variable/49422 "2020-11-01T18:57:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkarikom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkarikom/32/7096_2.png) [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Post date:** [November 1, 2020, 6:57pm UTC](https://discourse.julialang.org/t/how-do-i-find-which-module-exported-a-given-method-or-variable/49422/1 "2020-11-01T18:57:43Z")

</div>

How do I find which module exported a given method or variable?

**Background** :

- I have a script `MyScript.jl` which works
- I made `MyModule` that encapsulates some of it’s functions, and call them from `MyScript2.jl`
- `MyModule.foo()` throwing “`not defined`” error
- need to find what imports are missing in `MyModule`

Here is the error:

```julia
ERROR: UndefVarError: cm not defined
Stacktrace:
 [1] foo(::MetaDiGraph{Int64,Float64}, ::Array{Any,1}, ::String) at /home/me/MyModule.jl:200
 [2] top-level scope at /home/me/MyScript2.jl:135

```

Where `MyScript2.jl:135` is:

```julia
draw(PDF(string(drnm,paths[i].flowsL,"_path.pdf"), 16cm, 16cm), ggp)

```

---

<div class="post-metadata">

**Author:** ![josePereiro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josepereiro/32/17322_2.png) [@josePereiro](https://discourse.julialang.org/u/josePereiro)\
**Post date:** [November 1, 2020, 7:29pm UTC](https://discourse.julialang.org/t/how-do-i-find-which-module-exported-a-given-method-or-variable/49422/2 "2020-11-01T19:29:27Z")

</div>

The problem is that julia is giving you an error base on all the information it has. Literally `cm` is not defined, so julia can’t know what it is or where it come from. Anyway, from the context I think `cm` means centimeter. Using [Measures.jl](https://github.com/JuliaGraphics/Measures.jl) may solve your problem. Or maybe you can get it from the package that export `draw` that should import Measures internally. But this is just a guess, from the single line you provide.

---

<div class="post-metadata">

**Author:** ![mkarikom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkarikom/32/7096_2.png) [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Post date:** [November 1, 2020, 7:31pm UTC](https://discourse.julialang.org/t/how-do-i-find-which-module-exported-a-given-method-or-variable/49422/3 "2020-11-01T19:31:19Z")

</div>

> [@josePereiro](#):
>
> Or maybe you can get it from the package that export `draw` that should import Measures internally.

Thanks @josePereiro. What command can I use to find the package that exports `draw` (in this case I think it’s `GraphPlot` but in general I may not know)?

---

<div class="post-metadata">

**Author:** ![josePereiro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josepereiro/32/17322_2.png) [@josePereiro](https://discourse.julialang.org/u/josePereiro)\
**Post date:** [November 1, 2020, 7:33pm UTC](https://discourse.julialang.org/t/how-do-i-find-which-module-exported-a-given-method-or-variable/49422/4 "2020-11-01T19:33:00Z")

</div>

Try @which draw

---

<div class="post-metadata">

**Author:** ![mkarikom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkarikom/32/7096_2.png) [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Post date:** [November 1, 2020, 7:33pm UTC](https://discourse.julialang.org/t/how-do-i-find-which-module-exported-a-given-method-or-variable/49422/5 "2020-11-01T19:33:27Z")

</div>

works, thanks!

---

<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:** [November 2, 2020, 3:28pm UTC](https://discourse.julialang.org/t/how-do-i-find-which-module-exported-a-given-method-or-variable/49422/6 "2020-11-02T15:28:47Z")

</div>

`parentmodule(draw)`
