# Loading a module with Project.toml containing the name field but no uuid

**URL:** <https://discourse.julialang.org/t/loading-a-module-with-project-toml-containing-the-name-field-but-no-uuid/91651>\
**Category:** General Usage\
**Tags:** question, pkg\
**Created:** [December 14, 2022, 5:37pm UTC](https://discourse.julialang.org/t/loading-a-module-with-project-toml-containing-the-name-field-but-no-uuid/91651 "2022-12-14T17:37:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olivier\_Merchiers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olivier_merchiers/32/4073_2.png) [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Post date:** [December 14, 2022, 5:37pm UTC](https://discourse.julialang.org/t/loading-a-module-with-project-toml-containing-the-name-field-but-no-uuid/91651/1 "2022-12-14T17:37:50Z")

</div>

Hello everyone,

I’m on a constant quest to find the easiest way to load a module without using `include`.  
I discovered recently through the use of the [DrWatson.jl](https://github.com/JuliaDynamics/DrWatson.jl) package that you can do `using MyPkg` from its environment even though the package has no uuid defined.

Let’s say we have the following:

```julia
# MyPkg/src/MyPkg.jl

module MyPkg

plus_one(x) = x + 1 

end

```

```julia
# MyPkg/Project.toml
name = "MyPkg"

```

Note the absence of the the `uuid` field.

In the Pkg repl mode:

```julia
(@v1.8) pkg> activate .
(MyPkg) pkg>

```

In the activated environment I can do now

```julia
julia> using MyPkg
julia> MyPkg.plus_one(1.2)
2.2

```

Even though my Project.toml does not contain any uuid, I can still load MyPkg.  
This breaks if `MyPkg.jl` is not placed in the `src` folder.

This brings me to the following questions:

1. How is this possible? I could not find any explanation of this behaviour in the docs. Could someone point me to the relevant part of the documentation?

2. I had to create the Project.toml file manually in order to not get the uuid. Is there a way to generate such a project.toml file containing only a `name` field for the project and nothing else using the Pkg api?

Thanks in advance

Olivier

---

<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:** [December 14, 2022, 9:36pm UTC](https://discourse.julialang.org/t/loading-a-module-with-project-toml-containing-the-name-field-but-no-uuid/91651/2 "2022-12-14T21:36:55Z")

</div>

I think it gets assigned a “dummy UUID” based on the project path:

> <https://github.com/JuliaLang/julia/blob/7b10d5fe0159e21e8299681c33605f0b10dbdcfa/base/loading.jl#L593-L599>

---

<div class="post-metadata">

**Author:** ![Olivier\_Merchiers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olivier_merchiers/32/4073_2.png) [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Post date:** [December 14, 2022, 10:13pm UTC](https://discourse.julialang.org/t/loading-a-module-with-project-toml-containing-the-name-field-but-no-uuid/91651/3 "2022-12-14T22:13:31Z")

</div>

Oh yes indeed! I was missing the dummy uuid.

I think this is the relevant piece of documentation:

If `X/Project.toml` exists and but does _not_ have a top-level UUID entry, `uuid` is a dummy UUID generated by hashing the canonical (real) path to `X/Project.toml`.

Thanks a lot!
