# How to use local, relative modules (best practice, simple)?

**URL:** https://discourse.julialang.org/t/how-to-use-local-relative-modules-best-practice-simple/81634
**Category:** New to Julia
**Tags:** question, modules, code-organization
**Created:** [May 25, 2022, 6:31am UTC](https://discourse.julialang.org/t/how-to-use-local-relative-modules-best-practice-simple/81634 "2022-05-25T06:31:14Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![jakob1](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jakob1](https://discourse.julialang.org/u/jakob1)
#### Post date: [May 25, 2022, 11:10am UTC](https://discourse.julialang.org/t/how-to-use-local-relative-modules-best-practice-simple/81634/8 "2022-05-25T11:10:21Z")

</div>

> [@skleinbo](#):
>
> That said, I have `export JULIA_LOAD_PATH=".:$JULIA_LOAD_PATH"` in my shell profile. With that, `import X` will look for a file `X.jl` in the directory from which Julia was launched and load the module therein defined. That mimics Python’s behavior I think.  
> Discovery is case-sensitive, so you would need to rename `helper.jl -> Helper.jl` .

Thank you for this tipp!

Why doesn’t this work though, when there is a `Project.toml` file inside `testproj` project folder (I had added one before)? With same steps and existent file, it results in:

> ERROR: LoadError: ArgumentError: Package Helper not found in current path: Run `import Pkg; Pkg.add("Helper")` to install the Helper package.

One other thing: Shoudn’t it be sufficient to just specify `--project` argument to make modules available via `JULIA_LOAD_PATH`? Like

```julia
cd /path/to/testproj
julia --project=. main.jl

```

According to [LOAD\_PATH](https://docs.julialang.org/en/v1/base/constants/#Base.LOAD_PATH) docs:

> it defaults to `["@", "@v#.#", "@stdlib"]`

> `@` refers to the “current active environment”, the initial value of which is initially determined by the [`JULIA_PROJECT`](https://docs.julialang.org/en/v1/manual/environment-variables/#JULIA_PROJECT) environment variable or the `--project` command-line option.

Unfortunately, this does not work and `JULIA_LOAD_PATH` needs to be set manually.

* * *

Some more references:  
\https://discourse.julialang.org/t/how-to-add-a-folder-path-in-your-jl-script/61901  
\https://discourse.julialang.org/t/newbie-question-on-search-path/12384

---

_[View the full topic](https://discourse.julialang.org/t/how-to-use-local-relative-modules-best-practice-simple/81634)._
