# Creating an environment to use specific versions of packages, Julia uses most current anyway

**URL:** <https://discourse.julialang.org/t/creating-an-environment-to-use-specific-versions-of-packages-julia-uses-most-current-anyway/38021>\
**Category:** General Usage\
**Created:** [April 22, 2020, 11:22am UTC](https://discourse.julialang.org/t/creating-an-environment-to-use-specific-versions-of-packages-julia-uses-most-current-anyway/38021 "2020-04-22T11:22:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cby](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@cby](https://discourse.julialang.org/u/cby)\
**Post date:** [April 22, 2020, 11:22am UTC](https://discourse.julialang.org/t/creating-an-environment-to-use-specific-versions-of-packages-julia-uses-most-current-anyway/38021/1 "2020-04-22T11:22:47Z")

</div>

I am trying to create an environment as shown [here](https://julialang.github.io/Pkg.jl/v1.4/environments/) to specifically use an older version of a package (JuMPv.19), which seems to be successful.

```julia
(JuMPv.19) pkg> st
Status `~/JuliaEnvs/JuMPv.19/Project.toml`
  [2e9cd046] Gurobi v0.6.0
  [4076af6c] JuMP v0.19.2

```

However, when I actually run anything, it continues to use the current version of the package (JuMPv.21). When I run a simple program, I get an error that I should get with v.21 but should not get with v.19 (which is how I know it is not using the old version I want to use).

Does Julia look for some updated version of this package in a Manifest.toml outside my environment? What should I be doing instead?

---

<div class="post-metadata">

**Author:** ![leethargo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leethargo/32/6004_2.png) [@leethargo](https://discourse.julialang.org/u/leethargo)\
**Post date:** [April 22, 2020, 1:44pm UTC](https://discourse.julialang.org/t/creating-an-environment-to-use-specific-versions-of-packages-julia-uses-most-current-anyway/38021/2 "2020-04-22T13:44:38Z")

</div>

When you run a script from the command line, you can select the environment with the `julia --project PATH` argument.

---

<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:** [April 22, 2020, 4:21pm UTC](https://discourse.julialang.org/t/creating-an-environment-to-use-specific-versions-of-packages-julia-uses-most-current-anyway/38021/3 "2020-04-22T16:21:15Z")

</div>

You may be running into stacked environments:

[https://docs.julialang.org/en/v1/manual/code-loading/#Environment-stacks-1](https://docs.julialang.org/en/v1/manual/code-loading/#Environment-stacks-1)

> [@Shared environments](https://discourse.julialang.org/t/shared-environments/35999):
>
> I recently [learned](https://discourse.julialang.org/t/why-start-domain-specific-scientific-projects-as-packages/34752/11) about “shared environments”, aka the default v1.3 environment. It’s quite a revelation, but I don’t understand how it works. Suppose I have Package A which depends on B@v1.0.0, and is compatible with no other version of B. A is in the shared environment’s Project.toml. Environment E, which has package C in its Project.toml. C depends on B@v2.0.0 (compatible with no other version). When I am in E and I using A, which version of B is loaded?

If you previously activated an environment that (even indirectly) loaded the newer version of JuMP, the Manifest entry no longer matters.
