# Unexpected path structure for module

**URL:** https://discourse.julialang.org/t/unexpected-path-structure-for-module/137525
**Category:** General Usage
**Created:** [June 9, 2026, 11:09am UTC](https://discourse.julialang.org/t/unexpected-path-structure-for-module/137525 "2026-06-09T11:09:04Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)
#### Post date: [June 9, 2026, 11:09am UTC](https://discourse.julialang.org/t/unexpected-path-structure-for-module/137525/1 "2026-06-09T11:09:04Z")

</div>

I have a long term problem using `apropos()`:

```julia-auto
julia> apropos("interpolate")
Base.@async
Base.Regex
Base.@eval
Base.Threads.@spawn
DocStringExtensions.Abbreviation
DocStringExtensions.interpolation
MacroTools.@qq
MacroTools.@q
ERROR: Unexpected path structure for module source: /Users/Thomas/Documents/Julia/Extensions/Extensions.jl

```

I don’t see anything special inside my `Extensions` module. What should I do?

Thanks

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [June 9, 2026, 1:55pm UTC](https://discourse.julialang.org/t/unexpected-path-structure-for-module/137525/2 "2026-06-09T13:55:38Z")

</div>

> [@tomtom](#):
>
> `/Users/Thomas/Documents/Julia/Extensions/Extensions.jl`

Assuming this is intended to be a package, it may work better if you insert a `src` into the path.

```julia-auto
/Users/Thomas/Documents/Julia/Extensions/src/Extensions.jl

```

If that doesn’t help it would be useful to know more exactly what files are in `Julia/Extensions`.

---

<div class="post-metadata">

### Author: ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)
#### Post date: [June 9, 2026, 2:06pm UTC](https://discourse.julialang.org/t/unexpected-path-structure-for-module/137525/3 "2026-06-09T14:06:47Z")

</div>

the file is located exactly at

> [@tomtom](#):
>
> /Users/Thomas/Documents/Julia/Extensions/Extensions.jl

so, there’s no “src” sub-folder inside.

There’re other `.jl` inside `Extensions/`, but how does it matter?

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [June 9, 2026, 3:20pm UTC](https://discourse.julialang.org/t/unexpected-path-structure-for-module/137525/4 "2026-06-09T15:20:34Z")

</div>

Does it or does it not help to add a `src` directory in the layout?

Other `.jl` files might not be interesting but the presence or non-presence of `Project.toml` might be.

---

<div class="post-metadata">

### Author: ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)
#### Post date: [June 9, 2026, 3:27pm UTC](https://discourse.julialang.org/t/unexpected-path-structure-for-module/137525/5 "2026-06-09T15:27:16Z")

</div>

adding ‘src’ NOT help (actually NOT work because the path is invalid).

This problem persists for years. Everything is fine except that calling `apropos()` would trigger the error.

---

<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: [June 9, 2026, 4:37pm UTC](https://discourse.julialang.org/t/unexpected-path-structure-for-module/137525/6 "2026-06-09T16:37:13Z")

</div>

> [@tomtom](#):
>
> adding ‘src’ NOT help (actually NOT work because the path is invalid).

You need to actually restructure your package, i.e. move `Extensions/Extensions.jl` into `Extensions/src/Extensions.jl` … Julia expects packages to have a standardized directory structure.

---

<div class="post-metadata">

### Author: ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)
#### Post date: [June 10, 2026, 4:44am UTC](https://discourse.julialang.org/t/unexpected-path-structure-for-module/137525/7 "2026-06-10T04:44:52Z")

</div>

!!! I never know that Julia requires a specific path structure !!! anywhere in docs I could find related documents?

so, if I create a `src` folder and move everything in it, how should I add it to the `LOAD_PATH`?

now:

```julia-auto
push!(LOAD_PATH, joinpath(ROOT_PATH, "Extensions/") )

```

should I change it to:

```julia-auto
push!(LOAD_PATH, joinpath(ROOT_PATH, "Extensions/src") )

```

?

(`ROOT_PATH` is `/Users/Thomas/Documents/Julia`)

thanks

---

<div class="post-metadata">

### Author: ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)
#### Post date: [June 10, 2026, 7:41am UTC](https://discourse.julialang.org/t/unexpected-path-structure-for-module/137525/8 "2026-06-10T07:41:02Z")

</div>

You should not move “everything” into the `src/` folder, only the source files. The beginning here [5. Creating Packages · Pkg.jl](https://pkgdocs.julialang.org/v1/creating-packages/) provides an overview on the Folder structure.

For the remainder of a package, like tests, docs, the GitHub CI workflows, code formatting etc, there exist helpers like [BestieTemplate - Your best practices friend · BestieTemplate.jl](https://juliabesties.github.io/BestieTemplate.jl/stable/).

---

<div class="post-metadata">

### Author: ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)
#### Post date: [June 10, 2026, 8:40am UTC](https://discourse.julialang.org/t/unexpected-path-structure-for-module/137525/9 "2026-06-10T08:40:24Z")

</div>

wow `apropos()` works after moving to `src`! Thanks.

anyway, `LOAD_PATH` now should include `src` also:

```julia-auto
push!(LOAD_PATH, joinpath(ROOT_PATH, "Extensions/src") )

```

---

<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: [June 10, 2026, 11:57am UTC](https://discourse.julialang.org/t/unexpected-path-structure-for-module/137525/10 "2026-06-10T11:57:38Z")

</div>

> [@tomtom](#):
>
> so, if I create a `src` folder and move everything in it, how should I add it to the `LOAD_PATH`?

If you are using the package structure, it is better not to manually edit `LOAD_PATH`, but instead to use the package system, e.g. `dev` or `activate` commands, as described in the `Pkg` manual.
