# Julia cannot find the module file in the same directory of the main file

**URL:** <https://discourse.julialang.org/t/julia-cannot-find-the-module-file-in-the-same-directory-of-the-main-file/71213>\
**Category:** General Usage\
**Tags:** question, package\
**Created:** [November 9, 2021, 6:04pm UTC](https://discourse.julialang.org/t/julia-cannot-find-the-module-file-in-the-same-directory-of-the-main-file/71213 "2021-11-09T18:04:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_D](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adam_d/32/22716_2.png) [@Adam\_D](https://discourse.julialang.org/u/Adam_D)\
**Post date:** [November 9, 2021, 6:04pm UTC](https://discourse.julialang.org/t/julia-cannot-find-the-module-file-in-the-same-directory-of-the-main-file/71213/1 "2021-11-09T18:04:24Z")

</div>

Hi all,

I have script named “main.jl” that uses a module written by me named “PmFunc.jl”. I call PmFunc module within main.jl using "using PmFunc. Both of these files are in the same folder. To make sure that the folder is in the path I do

```julia
(pwd() in LOAD_PATH) ? print("working directory is in the path") : push!(LOAD_PATH,pwd())

```

in the begining of main.jl file.

Here is my weird problem. Everything works fine when I run the main.jl file that uses functions within PmFunc.jl. However, if I copy and paste the **entire folder** to somewhere else, I keep getting the following error.

```julia
LoadError: ArgumentError: Package PmFunc not found in current path: Julia

```

I have a feeling that this is somehow related to Project.toml, but I do not know why. I am a Julia newbie. Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![LeePhillips](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leephillips/32/205514_2.png) [@LeePhillips](https://discourse.julialang.org/u/LeePhillips)\
**Post date:** [November 9, 2021, 7:01pm UTC](https://discourse.julialang.org/t/julia-cannot-find-the-module-file-in-the-same-directory-of-the-main-file/71213/2 "2021-11-09T19:01:28Z")

</div>

`pwd()` tells you where you are when you invoke julia, not where the program file is. You might just want to `include()` the file if you’re using it this way.

---

<div class="post-metadata">

**Author:** ![Adam\_D](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adam_d/32/22716_2.png) [@Adam\_D](https://discourse.julialang.org/u/Adam_D)\
**Post date:** [November 11, 2021, 6:25am UTC](https://discourse.julialang.org/t/julia-cannot-find-the-module-file-in-the-same-directory-of-the-main-file/71213/3 "2021-11-11T06:25:00Z")

</div>

Thank you for your reply, however, pwd() does return where the file is. Neverthless, I deleted the aux. files in the folder restarted everything it somehow worked.

---

<div class="post-metadata">

**Author:** ![LeePhillips](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leephillips/32/205514_2.png) [@LeePhillips](https://discourse.julialang.org/u/LeePhillips)\
**Post date:** [November 11, 2021, 12:23pm UTC](https://discourse.julialang.org/t/julia-cannot-find-the-module-file-in-the-same-directory-of-the-main-file/71213/4 "2021-11-11T12:23:02Z")

</div>

> pwd() does return where the file is

Not in my world:

```julia
lee@tctmp0:pwd                                                                                                                          
/tmp
lee@tctmp0:cat where_am_I.jl 
println(pwd())
lee@tctmp0:cd /                                                                                                                         
lee@tc/0:julia /tmp/where_am_I.jl                                                                                                       
/

```
