# Create and use local module

**URL:** <https://discourse.julialang.org/t/create-and-use-local-module/46989>\
**Category:** New to Julia\
**Created:** [September 21, 2020, 9:16am UTC](https://discourse.julialang.org/t/create-and-use-local-module/46989 "2020-09-21T09:16:35Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [September 22, 2020, 1:58pm UTC](https://discourse.julialang.org/t/create-and-use-local-module/46989/10 "2020-09-22T13:58:18Z")

</div>

Maybe I am missing the point but this works for me:

**main.jl** :

```julia-auto
module myMain
# How to lod myPlot module here?

include("myPlot.jl")
using .myPlot

end # module

```

**myPlot.jl** :

```julia-auto
module myPlot

using Plots

function plotSine()
    x = LinRange(0,1,11)
    y = sin.(x)
    gr()
    p = plot(x,y, title="hi test 2")
    plot!(p,x,y.*2)
    display(p)
end

end

```

Both files in d:\Temp, in the REPL:

```julia-auto
julia> cd("d:\\temp")

julia> include("main.jl")

julia> myMain.myPlot.plotSine()

```

I once had a similar issue and got my help in this thread, maybe you find some insights too:

> [@Dependencies of src files inside a package](https://discourse.julialang.org/t/dependencies-of-src-files-inside-a-package/43144):
>
> I am struggling with dependencies of several files inside a project (MWE package M). I have illustrated the current structure (of a MWE), which reflects the natural separation of different parts of the real project: [dependency] For the MWE the package is named M with top file M.jl. It calls a function dfunc defined in d.jl. dfunc calls bfunc and cfunc from b.jl and c.jl. A common data type is Astruct, defined in a.jl and used directly in b.jl,c.jl and d.jl. The complete MWE package can be…

---

_[View the full topic](https://discourse.julialang.org/t/create-and-use-local-module/46989)._
