# How can I use a package (mine) as a sub Package

**URL:** <https://discourse.julialang.org/t/how-can-i-use-a-package-mine-as-a-sub-package/4738>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 8, 2017, 9:57am UTC](https://discourse.julialang.org/t/how-can-i-use-a-package-mine-as-a-sub-package/4738 "2017-07-08T09:57:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrKrar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/drkrar/32/3801_2.png) [@DrKrar](https://discourse.julialang.org/u/DrKrar)\
**Post date:** [July 8, 2017, 9:57am UTC](https://discourse.julialang.org/t/how-can-i-use-a-package-mine-as-a-sub-package/4738/1 "2017-07-08T09:57:46Z")

</div>

I know that i can use a package code to build up on. but i did not how i can do that without copying.

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [July 8, 2017, 1:14pm UTC](https://discourse.julialang.org/t/how-can-i-use-a-package-mine-as-a-sub-package/4738/2 "2017-07-08T13:14:08Z")

</div>

The question isn’t too clear but as far as I understand you want to use a module inside another one.

You can either define the module in a file and include that file using `include(filename)` then run `using modulename`. But you will have to make sure both files are in the same directory.

Or you could do `PkgDev.generate(packagename, license)` to make a folder for your package in the .julia\v0.6 directory then copy your source code to .julia\v0.6\packagename\src making sure the main file is named “packagename.jl”. Then you call `using packagename` from any other file, REPL session or notebook session, and the package will be available to you.

You can find more details on both of these methods in the docs.

I am not sure if that’s what you were asking about but it seems more of a Usage question than a Development one. Development is more about the Julia internals and language design.

---

<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:** [July 8, 2017, 3:13pm UTC](https://discourse.julialang.org/t/how-can-i-use-a-package-mine-as-a-sub-package/4738/3 "2017-07-08T15:13:35Z")

</div>

> [@mohamed82008](#):
>
> more of a Usage question than a Development one

Moved it (I still don’t understand the question though).
