# Issue: no way to include only once.

**URL:** <https://discourse.julialang.org/t/issue-no-way-to-include-only-once/19289>\
**Category:** General Usage\
**Tags:** question, package, proposal\
**Created:** [January 5, 2019, 2:08am UTC](https://discourse.julialang.org/t/issue-no-way-to-include-only-once/19289 "2019-01-05T02:08:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![houd1ni](https://avatars.discourse-cdn.com/v4/letter/h/9fc348/32.png) [@houd1ni](https://discourse.julialang.org/u/houd1ni)\
**Post date:** [January 5, 2019, 2:08am UTC](https://discourse.julialang.org/t/issue-no-way-to-include-only-once/19289/1 "2019-01-05T02:08:08Z")

</div>

[https://github.com/JuliaLang/julia/issues/30597](https://github.com/JuliaLang/julia/issues/30597)

Hi all!

After the last reply I still cannot just import without include.  
And include several times (per each Storage.) going into the same.

Also, is there a way to have modules with the same name in a project in different subdirectories?

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [January 5, 2019, 2:24am UTC](https://discourse.julialang.org/t/issue-no-way-to-include-only-once/19289/2 "2019-01-05T02:24:22Z")

</div>

> [@houd1ni](#):
>
> After the last reply I still cannot just import without include.

Note that this is exactly what issue#4600 is about so no, not for now. And from the way you’ve described it, i.e. “import without include” I hope it’s clear that this is a feature that belongs to `import`, not `include`. So `include` once really isn’t what you are looking for. It’s not even well defined and has no way to know anything about namespace. (If you make it namespace aware, it won’t be `include` anymore…)

In general, include is the function to organize code at a lower level since julia doesn’t enforce a 1-1 correspondence between file and module. `import` is the feature to, well, `import` names between namespaces (`module`).

The current way to do this is to figure out a correct way to include all code that satisfies your dependency requirement. Compared to python, this gives more flexibility, which is useful sometimes (certainly not always). You can recreate a python like nested structure by creating a tree-like include structures, see for example [the `DataStructures.jl` → `heaps.jl` → `heaps/*.jl` include tree](https://github.com/JuliaCollections/DataStructures.jl/blob/26e0229ac243079c071d4a47d16366fca40e4cdc/src/DataStructures.jl). It’s certainly not as automatic (#4600 will change that) but I’ve also have experience that when not keeping track of dependency in python explicitly, I’ve run into more import loops than I wish that are solved mostly by falling back to a global import order…
