# How to create module and call it from another file?

**URL:** <https://discourse.julialang.org/t/how-to-create-module-and-call-it-from-another-file/4186>\
**Category:** General Usage\
**Created:** [June 9, 2017, 5:25pm UTC](https://discourse.julialang.org/t/how-to-create-module-and-call-it-from-another-file/4186 "2017-06-09T17:25:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gopal2017](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gopal2017/32/31747_2.png) [@gopal2017](https://discourse.julialang.org/u/gopal2017)\
**Post date:** [June 9, 2017, 5:25pm UTC](https://discourse.julialang.org/t/how-to-create-module-and-call-it-from-another-file/4186/1 "2017-06-09T17:25:34Z")

</div>

Hi, I want to write a module and want to call some of its members such as type,function etc from another file by using the following command:  
using ModuleName  
Problem is to specify path of the module to julia.  
How to specify the path of module? Please let me know with small example.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [June 9, 2017, 5:29pm UTC](https://discourse.julialang.org/t/how-to-create-module-and-call-it-from-another-file/4186/2 "2017-06-09T17:29:34Z")

</div>

If you want a module that is not in the standard path (`LOAD_PATH` in Julia), just `include` it manually first. That is, if you have a file `/foo/bar/SomeModule.jl` that defines `module SomeModule`, you can do:

```julia
include("/foo/bar/SomeModule.jl")
using .SomeModule

```

The `.` in `using .SomeModule` ensures that the `SomeModule` in the current scope is what is used (see [https://docs.julialang.org/en/latest/manual/modules/#Relative-and-absolute-module-paths-1](https://docs.julialang.org/en/latest/manual/modules/#Relative-and-absolute-module-paths-1)).

---

<div class="post-metadata">

**Author:** ![gopal2017](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gopal2017/32/31747_2.png) [@gopal2017](https://discourse.julialang.org/u/gopal2017)\
**Post date:** [June 10, 2017, 1:42pm UTC](https://discourse.julialang.org/t/how-to-create-module-and-call-it-from-another-file/4186/3 "2017-06-10T13:42:41Z")

</div>

Hello,  
Yeah. I used same way. It’s working. I would like to know any  
other way so that julia solver could know its location. Just use LOAD\_PATH  
at Julia Prompt. It will show two different directories for Julia to locate  
module. It is like GAC in C#.  
Is there any other way to specify path for module?

Thanks,
