# How to include my module file as a package?

**URL:** <https://discourse.julialang.org/t/how-to-include-my-module-file-as-a-package/75682>\
**Category:** General Usage\
**Tags:** question, package, module\
**Created:** [February 2, 2022, 7:43pm UTC](https://discourse.julialang.org/t/how-to-include-my-module-file-as-a-package/75682 "2022-02-02T19:43:52Z")\
**Posts on this page:** 1\
**Showing post:** 11

<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:** [February 3, 2022, 9:13pm UTC](https://discourse.julialang.org/t/how-to-include-my-module-file-as-a-package/75682/11 "2022-02-03T21:13:50Z")

</div>

> [@Amro](#):
>
> I want to import my structures from my module as below (as a package), however, I have an error. Any idea to solve that?

I would just [create an actual package](https://pkgdocs.julialang.org/v1/creating-packages/) (you don’t have to register it publicly); it’s the best way to organize and re-use any nontrivial amount of code in the long run. See also

> [@Best practise: organising code in Julia](https://discourse.julialang.org/t/best-practise-organising-code-in-julia/74362/2):
>
> See many previous discussions: [Pros & Cons of using modules vs plain include?](https://discourse.julialang.org/t/pros-cons-of-using-modules-vs-plain-include/14694) and [Single module vs. submodules in a project](https://discourse.julialang.org/t/single-module-vs-submodules-in-a-project/55361) and [Large programs: structuring modules & include such that to increase performance and readability](https://discourse.julialang.org/t/large-programs-structuring-modules-include-such-that-to-increase-performance-and-readability/29102) and [What is the preferred way to use multiple files?](https://discourse.julialang.org/t/what-is-the-preferred-way-to-use-multiple-files/30687) TLDR: Start with a single module in a single package, split into as many files as you want, and refactor as needed later on. [Create at least one package](https://pkgdocs.julialang.org/v1/creating-packages/) for any major project, so that you can benefit from the Julia pack…

(With your code in a package, [use Revise.jl](https://github.com/timholy/Revise.jl) — then your files will automatically be re-loaded as needed when you edit the files during development.)

---

_[View the full topic](https://discourse.julialang.org/t/how-to-include-my-module-file-as-a-package/75682)._
