# Relative module paths

**URL:** <https://discourse.julialang.org/t/relative-module-paths/17659>\
**Category:** General Usage\
**Tags:** module\
**Created:** [November 17, 2018, 10:09pm UTC](https://discourse.julialang.org/t/relative-module-paths/17659 "2018-11-17T22:09:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdkrmr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdkrmr/32/2791_2.png) [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Post date:** [November 17, 2018, 10:09pm UTC](https://discourse.julialang.org/t/relative-module-paths/17659/1 "2018-11-17T22:09:09Z")

</div>

In `t2.jl` I can use both `import ..MyPkg` and `import ...MyPkg`, is this a feature? It seems to be safe though, because Modules cannot contain modules with the same name.

```julia
MyPkg
├── Manifest.toml
├── Project.toml
└── src
    ├── MyPkg.jl
    ├── t1.jl
    └── t2.jl

```

MyPkg.jl:

```julia
module MyPkg
g(x) = 2 + x
include("t1.jl")
include("t2.jl")
end

```

t1.jl:

```julia
module SubMod1
f(x) = x^2
end

```

t2.jl:

```julia
module SubMod2
import ...MyPkg
import ..SubMod1
f2(x) = MyPkg.g(x) * SubMod1.f(x)
end

```
