# Expected the file \`src/HijriConverter.jl\` to exist for package \`HijriConverter\` at \`.../HijriConverter.jl\`

**URL:** <https://discourse.julialang.org/t/expected-the-file-src-hijriconverter-jl-to-exist-for-package-hijriconverter-at-hijriconverter-jl/73935>\
**Category:** New to Julia\
**Tags:** package, pkg\
**Created:** [January 2, 2022, 5:23pm UTC](https://discourse.julialang.org/t/expected-the-file-src-hijriconverter-jl-to-exist-for-package-hijriconverter-at-hijriconverter-jl/73935 "2022-01-02T17:23:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jafar.isbarov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jafar.isbarov/32/36130_2.png) [@jafar.isbarov](https://discourse.julialang.org/u/jafar.isbarov)\
**Post date:** [January 2, 2022, 5:23pm UTC](https://discourse.julialang.org/t/expected-the-file-src-hijriconverter-jl-to-exist-for-package-hijriconverter-at-hijriconverter-jl/73935/1 "2022-01-02T17:23:56Z")

</div>

I am trying to add dependencies to a package that I am developing, but I get the following error:

```julia
(HijriConverter) pkg> add Parameters
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
ERROR: expected the file `src/HijriConverter.jl` to exist for package `HijriConverter` at `/home/jafar_isbarov/Documents/projects/hijri/hijri-converter-julia-package/HijriConverter.jl`

```

Adding a file named `HijriConverter` to the `src` folder does solve the problem. I have two questions.

(1) Why do I need a file with the same name as the package? Is it supposed to have certain content?  
(2) If I add that file, add dependencies, and delete the file afterwards, will that cause any problems?

Thanks.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [January 2, 2022, 5:32pm UTC](https://discourse.julialang.org/t/expected-the-file-src-hijriconverter-jl-to-exist-for-package-hijriconverter-at-hijriconverter-jl/73935/2 "2022-01-02T17:32:01Z")

</div>

> [@jafar.isbarov](#):
>
> Why do I need a file with the same name as the package? Is it supposed to have certain content?

Because that is the required package structure. It is supposed to have

```julia
module HijiriConverter

# package code here

end

```

in it

---

<div class="post-metadata">

**Author:** ![jafar.isbarov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jafar.isbarov/32/36130_2.png) [@jafar.isbarov](https://discourse.julialang.org/u/jafar.isbarov)\
**Post date:** [January 2, 2022, 5:34pm UTC](https://discourse.julialang.org/t/expected-the-file-src-hijriconverter-jl-to-exist-for-package-hijriconverter-at-hijriconverter-jl/73935/3 "2022-01-02T17:34:27Z")

</div>

But HijriConverter is a reasonable name for the package, but not a reasonable one for any of the modules. Is it considered a bad practice to create this module and leave it empty? (FYI, I do have a module named “core”).

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [January 2, 2022, 6:05pm UTC](https://discourse.julialang.org/t/expected-the-file-src-hijriconverter-jl-to-exist-for-package-hijriconverter-at-hijriconverter-jl/73935/4 "2022-01-02T18:05:35Z")

</div>

> [@jafar.isbarov](#):
>
> But HijriConverter is a reasonable name for the package, but not a reasonable one for any of the modules.

A package named “HijriConverter” _needs_ to have a module with that name in order to function properly.

All the content of the package need to be within that module.

---

<div class="post-metadata">

**Author:** ![jafar.isbarov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jafar.isbarov/32/36130_2.png) [@jafar.isbarov](https://discourse.julialang.org/u/jafar.isbarov)\
**Post date:** [January 2, 2022, 6:09pm UTC](https://discourse.julialang.org/t/expected-the-file-src-hijriconverter-jl-to-exist-for-package-hijriconverter-at-hijriconverter-jl/73935/5 "2022-01-02T18:09:17Z")

</div>

I see, thanks. What if I want to distribute the package across multiple modules (as it is easily done with, say, Python)? Is there a way to do that? Pkg documentation is not really helpful in this case.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [January 2, 2022, 6:46pm UTC](https://discourse.julialang.org/t/expected-the-file-src-hijriconverter-jl-to-exist-for-package-hijriconverter-at-hijriconverter-jl/73935/6 "2022-01-02T18:46:12Z")

</div>

You can absolutely do that. I don’t think it’s quite as idiomatic as in Python (which, iiuc, has a module = file thing going on), but you can. Then you `include` the file containing a module, and use `import .Submodule` (the period denoting a local/relative module).

But the most common way to split code up is to simply `include` the files, making them part of the main package module.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [January 2, 2022, 7:29pm UTC](https://discourse.julialang.org/t/expected-the-file-src-hijriconverter-jl-to-exist-for-package-hijriconverter-at-hijriconverter-jl/73935/7 "2022-01-02T19:29:44Z")

</div>

> [@jafar.isbarov](#):
>
> What if I want to distribute the package across multiple modules (as it is easily done with, say, Python)?

You typically have it like:

`HijriConverter.jl`:

```julia
module HijriConverter

some_function(x) = ....

include("OtherModule.jl")

end

```

`OtherModule.jl`:

```julia
module OtherModule

some_other_function(x) = ...

end

```
