# Add local package at specific version

**URL:** <https://discourse.julialang.org/t/add-local-package-at-specific-version/87153>\
**Category:** New to Julia\
**Tags:** package\
**Created:** [September 12, 2022, 4:56pm UTC](https://discourse.julialang.org/t/add-local-package-at-specific-version/87153 "2022-09-12T16:56:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [September 12, 2022, 4:56pm UTC](https://discourse.julialang.org/t/add-local-package-at-specific-version/87153/1 "2022-09-12T16:56:19Z")

</div>

Hi,  
To install a local package I usually use `] add` or `] dev` + the path to the package folder. Is there a way yo install a package at a specific version?

Something like : `] add c:/MyPackage@0.0.2`

If I want to install at a specific commit it seems the following is working:

`] add c:/MyPackage#12345gd2`

(By the way the progress bar is totally messed up when I use the above command in Windows)

Thank you

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [September 13, 2022, 12:29pm UTC](https://discourse.julialang.org/t/add-local-package-at-specific-version/87153/2 "2022-09-13T12:29:15Z")

</div>

I guess you can install at the commit that corresponds to the version release tag, but manually finding that can be extra work.

This is about dependencies of a project, but have a read of [6. Compatibility · Pkg.jl](https://pkgdocs.julialang.org/v1/compatibility/)  
Among other useful information, it has this statement:

> There is currently no way to give compatibility from the Pkg REPL mode so for now, one has to manually edit the project file.

---

<div class="post-metadata">

**Author:** ![digital\_carver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/digital_carver/32/33818_2.png) [@digital\_carver](https://discourse.julialang.org/u/digital_carver)\
**Post date:** [September 13, 2022, 12:47pm UTC](https://discourse.julialang.org/t/add-local-package-at-specific-version/87153/3 "2022-09-13T12:47:02Z")

</div>

It seems `add` of a local directory with a version number is explicitly disallowed: `add /path/to/package @1.0` returns  
`ERROR: version specification invalid when tracking a repository: `1.0` specified for package `/path/to/package` `

For one-off usage, you can get the commit corresponding to a tag wtih `git rev-list -n 1 v0.0.2` ([source](https://stackoverflow.com/a/1862542/8127)) on the command line and add with that commit hash.

If you have need to do this regularly with a package, a [local registry](https://github.com/GunnarFarneback/LocalRegistry.jl) might make this easier.

---

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [September 13, 2022, 8:22pm UTC](https://discourse.julialang.org/t/add-local-package-at-specific-version/87153/4 "2022-09-13T20:22:51Z")

</div>

Thank you for your replies and help.

---

<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:** [September 13, 2022, 8:30pm UTC](https://discourse.julialang.org/t/add-local-package-at-specific-version/87153/5 "2022-09-13T20:30:04Z")

</div>

If you have a git tag corresponding to your version you can add with `path#tag`.
