# How to specify pkg environment for Visual Studio Code project?

**URL:** https://discourse.julialang.org/t/how-to-specify-pkg-environment-for-visual-studio-code-project/90868
**Category:** New to Julia
**Created:** [November 26, 2022, 10:23pm UTC](https://discourse.julialang.org/t/how-to-specify-pkg-environment-for-visual-studio-code-project/90868 "2022-11-26T22:23:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [November 26, 2022, 10:23pm UTC](https://discourse.julialang.org/t/how-to-specify-pkg-environment-for-visual-studio-code-project/90868/1 "2022-11-26T22:23:19Z")

</div>

Hi, I have done:

```julia
] activate MyPackage

```

And then everything works correctly, i.e. adding packages only into this project when doing Pkg.add etc.

But whenever I try to execute some code from Visual Studio Code I have to consistenly activate again if I exit terminal.

How to avoid this?

Kind regards

---

<div class="post-metadata">

### Author: ![dylanxyz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dylanxyz/32/36646_2.png) [@dylanxyz](https://discourse.julialang.org/u/dylanxyz)
#### Post date: [November 26, 2022, 11:07pm UTC](https://discourse.julialang.org/t/how-to-specify-pkg-environment-for-visual-studio-code-project/90868/2 "2022-11-26T23:07:19Z")

</div>

Press `CTRL + Shift + P` and search for the command `Julia: Start REPL`. The REPL will automatically start with the current env that the Julia Extension is using.

![Julia Repl](https://global.discourse-cdn.com/julialang/original/3X/9/c/9cb1ecb09e4a5be0e64c39336730c99e46733bdd.png)

![image](https://global.discourse-cdn.com/julialang/original/3X/a/4/a43069605d5b5203edd6d0f80b06b92241dc20de.png)

---

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [November 26, 2022, 11:27pm UTC](https://discourse.julialang.org/t/how-to-specify-pkg-environment-for-visual-studio-code-project/90868/3 "2022-11-26T23:27:06Z")

</div>

How do I change the current environment?

It still sticks to @v1.8 even when I do it the way you showed me 😊

Kind regards

---

<div class="post-metadata">

### Author: ![dylanxyz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dylanxyz/32/36646_2.png) [@dylanxyz](https://discourse.julialang.org/u/dylanxyz)
#### Post date: [November 26, 2022, 11:35pm UTC](https://discourse.julialang.org/t/how-to-specify-pkg-environment-for-visual-studio-code-project/90868/4 "2022-11-26T23:35:19Z")

</div>

If you click were i highlighted in the last image, a menu will open for you to choose an environment.

![image](https://global.discourse-cdn.com/julialang/original/3X/3/4/342cc9b084e94eb7125685a159381469bf0a129a.png)

![image](https://global.discourse-cdn.com/julialang/original/3X/7/d/7d458dcba48e366023e42598894078d8e5e94dc4.png)

Normally you wouldn’t need to do that, because the extension can automatically determine which environment to use. But sometimes that doesn’t work.

Edit: you would only need to do this once.

---

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [November 27, 2022, 6:59am UTC](https://discourse.julialang.org/t/how-to-specify-pkg-environment-for-visual-studio-code-project/90868/5 "2022-11-27T06:59:55Z")

</div>

Thank you!

Works exactly as you describe. Quite obvious in hindsight, my eyes was just looking everywhere instead of bottom left…

Kind regards
