# How to switch between dev and normal version of the same package

**URL:** <https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396>\
**Category:** General Usage\
**Tags:** pkg\
**Created:** [March 1, 2023, 3:43pm UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396 "2023-03-01T15:43:49Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![JianghuiDu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jianghuidu/32/8028_2.png) [@JianghuiDu](https://discourse.julialang.org/u/JianghuiDu)\
**Post date:** [March 1, 2023, 3:43pm UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396/1 "2023-03-01T15:43:49Z")

</div>

I’m developing a package which is stored in my Github rep but not registered with Julia. I have the `dev` version in the `.julia/dev` directory, and I also install the normal version from Github in the `.julia/packages` directory. But how do I switch between these two versions? I tried to `free` the `dev` version of the package but it doesn’t work: `ERROR: unable to free unregistered package`.

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [March 1, 2023, 4:06pm UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396/2 "2023-03-01T16:06:10Z")

</div>

Any reason why can’t just add the unregistered package by its url?

```julia
(v1.1) pkg> add https://github.com/JuliaLang/Example.jl

```

(from [Pkg · The Julia Language](https://docs.julialang.org/en/v1/stdlib/Pkg/))

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 1, 2023, 4:19pm UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396/3 "2023-03-01T16:19:36Z")

</div>

That’s a package prompt I haven’t seen in a while 😂

---

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [March 1, 2023, 4:42pm UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396/4 "2023-03-01T16:42:16Z")

</div>

Correct me if I am wrong but I have this impression that if you want to use the registered version of the package in your script or function you go

```julia
Pkg.add Example

```

and if you want to use the development version go

```julia
Pkg.dev Example

```

---

<div class="post-metadata">

**Author:** ![vettert](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vettert/32/30599_2.png) [@vettert](https://discourse.julialang.org/u/vettert)\
**Post date:** [March 1, 2023, 5:09pm UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396/5 "2023-03-01T17:09:53Z")

</div>

Yeah, Julia 1.1 - maybe time to upgrade 🙂

---

<div class="post-metadata">

**Author:** ![JianghuiDu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jianghuidu/32/8028_2.png) [@JianghuiDu](https://discourse.julialang.org/u/JianghuiDu)\
**Post date:** [March 2, 2023, 8:31am UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396/6 "2023-03-02T08:31:19Z")

</div>

Yes. I can move to the dev version by `dev`, but how to I go back to the normal version? Do I have to `add` the normal version from github every time I use it?

---

<div class="post-metadata">

**Author:** ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)\
**Post date:** [March 2, 2023, 9:59am UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396/7 "2023-03-02T09:59:36Z")

</div>

You can use `free`

```julia-repl
help?> Pkg.free
  Pkg.free(pkg::Union{String, Vector{String}}; io::IO=stderr, all_pkgs::Bool=false)
  Pkg.free(pkgs::Union{PackageSpec, Vector{PackageSpec}}; io::IO=stderr, all_pkgs::Bool=false)

  If pkg is pinned, remove the pin. If pkg is tracking a path, e.g. after Pkg.develop, go
  back to tracking registered versions. To free all dependencies set all_pkgs=true.

  │ Julia 1.7
  │
  │ The all_pkgs kwarg was introduced in julia 1.7.

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  Pkg.free("Package")
  Pkg.free(all_pkgs = true)

```

---

<div class="post-metadata">

**Author:** ![JianghuiDu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jianghuidu/32/8028_2.png) [@JianghuiDu](https://discourse.julialang.org/u/JianghuiDu)\
**Post date:** [March 2, 2023, 10:21am UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396/8 "2023-03-02T10:21:16Z")

</div>

> [@JianghuiDu](#):
>
> `ERROR: unable to free unregistered package`.

That doesn’t work because the package is not registered:  
`ERROR: unable to free unregistered package`

---

<div class="post-metadata">

**Author:** ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)\
**Post date:** [March 2, 2023, 10:51am UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396/9 "2023-03-02T10:51:57Z")

</div>

Ahh, right. Missed that part.

Would guess the easiest is then to add/dev back and forth if you need to.

Or, depending on your use case, maybe you can split it up in different envs, one with add and one with dev, and just switch between them?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [March 2, 2023, 12:20pm UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396/10 "2023-03-02T12:20:13Z")

</div>

You can create your own registry where you add your package. You don’t need to add any versions, but just having the relevant `Package.toml` file in your registry makes it possible to at least to `pkg> add Package#master` (or any other git revision).

---

<div class="post-metadata">

**Author:** ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Post date:** [March 2, 2023, 12:25pm UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396/11 "2023-03-02T12:25:41Z")

</div>

And to make this easier:

> **[GitHub - GunnarFarneback/LocalRegistry.jl: Create and maintain local...](https://github.com/GunnarFarneback/LocalRegistry.jl)**
>
> Create and maintain local registries for Julia packages. - GitHub - GunnarFarneback/LocalRegistry.jl: Create and maintain local registries for Julia packages.

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [March 2, 2023, 12:28pm UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396/12 "2023-03-02T12:28:03Z")

</div>

Another option that I would use (but requires some comfort with git) would be sticking with the one in your `~/.julia/dev` directory, and just doing `git checkout devbranch` and `git checkout v0.whatever #the release version`.
