# Import the same package after activating new environment

**URL:** <https://discourse.julialang.org/t/import-the-same-package-after-activating-new-environment/43749>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [July 27, 2020, 8:58am UTC](https://discourse.julialang.org/t/import-the-same-package-after-activating-new-environment/43749 "2020-07-27T08:58:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [July 27, 2020, 11:41am UTC](https://discourse.julialang.org/t/import-the-same-package-after-activating-new-environment/43749/3 "2020-07-27T11:41:52Z")

</div>

The version of the package is determined at the time of `Pkg.add`. `import` or `using` just gets its version from `Manifest.toml`.

In your case, in the REPL you will get 0.6.2 – which is really saying: in the `v1.4.2` environment (or whatever your version is), this is what you will get.

In the other environment, `Manifest.toml` points to 0.7.4, so that’s what you will get. Except that you are actually in a stacked environment (where the dependencies of `v1.4.2` and `other` are both available. My understanding is that the most recently activated environment wins in this case (so you should get 0.7.4). See

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

and

> [@Shared environments](https://discourse.julialang.org/t/shared-environments/35999/2):
>
> I think you will find this useful:

But if you start Julia, issue `using CSV`, then activate `other` and try `using CSV` again, you are stuck with the version that’s already loaded.

`pkg> st` shows the package versions resolved in the current environment.

The reason why you could load `Primes` is likely a stacked environment as well. If it isn’t in the `Manifest.toml` for a package you activate in this session, you cannot load it.

As for upgrading: you don’t upgrade what’s in the depot. You upgrade what is in the current environment’s `Manifest.toml`. So, `pkg> up CSV` in `other` changes the version in `other` but nowhere else.

---

_[View the full topic](https://discourse.julialang.org/t/import-the-same-package-after-activating-new-environment/43749)._
