# Use stable version of package while developing

**URL:** <https://discourse.julialang.org/t/use-stable-version-of-package-while-developing/49261>\
**Category:** General Usage\
**Created:** [October 29, 2020, 8:39pm UTC](https://discourse.julialang.org/t/use-stable-version-of-package-while-developing/49261 "2020-10-29T20:39:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [October 29, 2020, 8:39pm UTC](https://discourse.julialang.org/t/use-stable-version-of-package-while-developing/49261/1 "2020-10-29T20:39:45Z")

</div>

I am developing a package, changing the files in `.julia/dev/Package`. Usually, my development workflow is:

```julia
using Revise
] dev Package
using Package

```

However, from time to time I want to use the stable version of the same package. Then, I want to start a Julia session and use:

```julia
using Package

```

and I expected that the stable version of the package was loaded in this case, not the development one from `.julia/dev/`, which might be even broken.

Am I doing something wrong? I think that the development versions of the packages should not be loaded unless one explicitly states that. But, anyway, how do I use the stable version of my package if I want to, without removing the data from `dev`?

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [October 29, 2020, 8:59pm UTC](https://discourse.julialang.org/t/use-stable-version-of-package-while-developing/49261/2 "2020-10-29T20:59:12Z")

</div>

I think it all comes to environments. If `using Package` do not throw an error, then `Package` is present/installed in the environment you are currently using (if you did not `activate` any environment, then you are using the general/global one). If you used `dev Package` in your environment then you changed the version of `Package` available in that environment to a `dev` version. You may want to have two distinct folders/projects, each with their own environment (i.e., `Project.toml` and `Manifest.toml`), in which one of them you have the dev version and in another the stable version. Otherwise (i.e., if you want to do this in the same folder), you will need to be changing through and back the package version in the single environment you are using (i.e., removing the `dev`ed package and reinstalling the not `dev` one).

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [October 29, 2020, 10:38pm UTC](https://discourse.julialang.org/t/use-stable-version-of-package-while-developing/49261/3 "2020-10-29T22:38:31Z")

</div>

If you start from `~/.julia/dev/Package` and then start Julia with `julia --project`, you’ll start with the "dev"ved version without needing to `dev` it in your default environment.

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [October 29, 2020, 10:39pm UTC](https://discourse.julialang.org/t/use-stable-version-of-package-while-developing/49261/4 "2020-10-29T22:39:54Z")

</div>

Also worth nothing that Revise typically lets you toggle back and forth between the released version and the devved version in the same session. (Exceptions are changes Revise can’t handle, like altered `struct` definitions.)

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [October 29, 2020, 11:21pm UTC](https://discourse.julialang.org/t/use-stable-version-of-package-while-developing/49261/5 "2020-10-29T23:21:16Z")

</div>

Thank you both. I got it. I had a misconception on what `dev ...` meant. I got the logic of the activation of environments now.

---

<div class="post-metadata">

**Author:** ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Post date:** [October 29, 2020, 11:33pm UTC](https://discourse.julialang.org/t/use-stable-version-of-package-while-developing/49261/6 "2020-10-29T23:33:21Z")

</div>

How do you do this? Can you give an example?

sec ing and hoping to find.

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [October 30, 2020, 7:47am UTC](https://discourse.julialang.org/t/use-stable-version-of-package-while-developing/49261/7 "2020-10-30T07:47:28Z")

</div>

There’s nothing to it, see the example in the [docs](https://timholy.github.io/Revise.jl/stable/#Other-key-features-of-Revise-1). You can toggle back and forth as many times as you want. This is super-useful if you want to check that a test fails on the released version but passes with your bugfix.

---

<div class="post-metadata">

**Author:** ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Post date:** [October 30, 2020, 10:05am UTC](https://discourse.julialang.org/t/use-stable-version-of-package-while-developing/49261/8 "2020-10-30T10:05:15Z")

</div>

Yup. That’s easy.
