# Can the preexisting uuid for a package be calculated with Julia 1.4?

**URL:** <https://discourse.julialang.org/t/can-the-preexisting-uuid-for-a-package-be-calculated-with-julia-1-4/39573>\
**Category:** General Usage\
**Created:** [May 16, 2020, 4:03am UTC](https://discourse.julialang.org/t/can-the-preexisting-uuid-for-a-package-be-calculated-with-julia-1-4/39573 "2020-05-16T04:03:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wherrera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wherrera/32/5288_2.png) [@wherrera](https://discourse.julialang.org/u/wherrera)\
**Post date:** [May 16, 2020, 4:03am UTC](https://discourse.julialang.org/t/can-the-preexisting-uuid-for-a-package-be-calculated-with-julia-1-4/39573/1 "2020-05-16T04:03:52Z")

</div>

It seems that in Julia 1.4 that Pkg.METADATA\_compatible\_uuid is dropped in favor of just creating a UUID randomly with UUIDs.uuid4().

However, when creating a Project.toml file for a package, we need to know the uuid that has been _already created_ for each of the package dependencies. Since METADATA\_compatible\_uuid is not available for this in Julia 1.4, is there a way, such as a magic RNG seed, other than searching the Julia directories or github for previous Project.toml files, to still calculate this from the module’s name?

---

<div class="post-metadata">

**Author:** ![Nosferican](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nosferican/32/9275_2.png) [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Post date:** [May 16, 2020, 6:13am UTC](https://discourse.julialang.org/t/can-the-preexisting-uuid-for-a-package-be-calculated-with-julia-1-4/39573/2 "2020-05-16T06:13:07Z")

</div>

You can use `]add PkgName` and it will add entry to the `Project.toml`. It will just look it up in the local copy of the General registry and pull the UUID from it.

---

<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:** [May 16, 2020, 10:35am UTC](https://discourse.julialang.org/t/can-the-preexisting-uuid-for-a-package-be-calculated-with-julia-1-4/39573/3 "2020-05-16T10:35:21Z")

</div>

Package UUIDs can indeed only be obtained from the packages’ `Project.toml` or from the registries, which collect such information. But the intention is that the tooling should rarely make it necessary for you to handle UUIDs manually. So the fact that you’re asking this question seems to indicate that you’re missing some tool or use them in an unusual way. What is it you want to achieve?

(`Pkg.METADATA_compatible_uuid` was only ever intended for transition purposes from the previous generation of the package manager. A fully deterministic mapping from package names to UUIDs would clash with the design goal of making it possible to handle multiple packages with the same name and also make the UUIDs rather pointless in the first place.)

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [May 16, 2020, 2:43pm UTC](https://discourse.julialang.org/t/can-the-preexisting-uuid-for-a-package-be-calculated-with-julia-1-4/39573/4 "2020-05-16T14:43:11Z")

</div>

> [@GunnarFarneback](#):
>
> So the fact that you’re asking this question seems to indicate that you’re missing some tool or use them in an unusual way.

Or just trying to upgrade an old package to Project.toml format. I did this just the other day and ran into exactly the same issue. My solution was to do the upgrade in Julia 1.3.

---

<div class="post-metadata">

**Author:** ![wherrera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wherrera/32/5288_2.png) [@wherrera](https://discourse.julialang.org/u/wherrera)\
**Post date:** [May 16, 2020, 8:02pm UTC](https://discourse.julialang.org/t/can-the-preexisting-uuid-for-a-package-be-calculated-with-julia-1-4/39573/5 "2020-05-16T20:02:14Z")

</div>

Yes, occasionally I have to use an older Github hosted package in Julia 1+. I have been manually adding the Project.toml to my Github hosted fork.

---

<div class="post-metadata">

**Author:** ![avik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/avik/32/17_2.png) [@avik](https://discourse.julialang.org/u/avik)\
**Post date:** [May 16, 2020, 8:43pm UTC](https://discourse.julialang.org/t/can-the-preexisting-uuid-for-a-package-be-calculated-with-julia-1-4/39573/6 "2020-05-16T20:43:42Z")

</div>

So if the project is already in the `General` registry, then just copy the UUID from the registry itself ([GitHub - JuliaRegistries/General: The official registry of general Julia packages](https://github.com/juliaregistries/General)). If this is a old project, but one that was never in `METADATA` or General Registry, just use a new, “random” UUID. The `METADATA_compatiple_uuid` function was useful only in the transition from the old `METADATA`, as the name suggests.
