# Packages installed in VSCode disappeared in Windows Powershell?

**URL:** https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166
**Category:** General Usage
**Tags:** question, package, vscode
**Created:** [November 27, 2024, 1:20pm UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166 "2024-11-27T13:20:45Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)
#### Post date: [November 27, 2024, 1:20pm UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/1 "2024-11-27T13:20:45Z")

</div>

In VSCode I have installed two packages in the default `@v1.11` environment:

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

But when I opened Windows Powershell to start `julia` and typed `] st` I found there is nothing:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/2/22c706fd12c285d4667e0b61bbce9f02f3eb5406.png)

Why?

---

<div class="post-metadata">

### Author: ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)
#### Post date: [November 27, 2024, 1:30pm UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/2 "2024-11-27T13:30:42Z")

</div>

What’s more, if I open a project folder and open Windows PowerShell here, then type `julia` to start julia and type `] activate .`, nothing will happen:

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

while if I do so in VSCode, things will go as expectation.

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [November 27, 2024, 1:40pm UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/3 "2024-11-27T13:40:19Z")

</div>

Not an answer to your question, but I would not use Julia in Powershell, I would prefer to use Bash. If you have installed [gitforwindows](https://gitforwindows.org/), then you also have a bash shell on Windows. Best to use together with [WindowsTerminal](https://apps.microsoft.com/detail/9n0dx20hk701?hl=en-US&gl=US).

---

<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: [November 27, 2024, 2:00pm UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/4 "2024-11-27T14:00:42Z")

</div>

This is not a case of packages disappearing, but rather of your Powershell not printing any output - even if your default environment doesn’t exist, you should get

```julia
(@v1.10) pkg> st
Status `~/.julia/environments/v1.10/Project.toml` (empty project)

```

rather than no output at all.

---

<div class="post-metadata">

### Author: ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)
#### Post date: [November 27, 2024, 2:47pm UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/5 "2024-11-27T14:47:11Z")

</div>

How to set the default environment then? On my old PC I could use Julia in both VSCode and PowerShell in a same fashion but on this new PC things changed.

---

<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: [November 27, 2024, 3:32pm UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/6 "2024-11-27T15:32:17Z")

</div>

My point is that there seems to be something broken with your Julia install or Powershell, this isn’t actually a problem about setting the default environment. Both `]st` and `] activate .` should print something, but you’re not getting any output,.

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [November 27, 2024, 5:03pm UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/7 "2024-11-27T17:03:48Z")

</div>

Are you using WindowsTerminal? If not, please try that out.

---

<div class="post-metadata">

### Author: ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)
#### Post date: [November 28, 2024, 12:33am UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/8 "2024-11-28T00:33:17Z")

</div>

Yes, I am using Win11 and it is a newly installed system. What’s different is that this was my first time trying to install julia via command prompt according to [Download Julia](https://julialang.org/downloads/#install_julia). And I found that this seems to install julia only for the current user accoun but not for all users of this computer.

---

<div class="post-metadata">

### Author: ![xgdgsc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xgdgsc/32/608_2.png) [@xgdgsc](https://discourse.julialang.org/u/xgdgsc)
#### Post date: [November 28, 2024, 7:19am UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/9 "2024-11-28T07:19:04Z")

</div>

`Get-ChildItem Env:`

in both vscode and terminal and compare output

---

<div class="post-metadata">

### Author: ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)
#### Post date: [November 28, 2024, 9:31am UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/10 "2024-11-28T09:31:55Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/d/5/d5ab230ad70517ad5445324fdd7f9bb55d765b14.png)  
Can the above phenomenon explain anything? As I understand it, does this mean that there is a problem with Julia’s installation so that juliaup cannot recognize julia 1.11.1? If so, how should I completely remove and reinstall Julia?

---

<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: [November 28, 2024, 9:46am UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/11 "2024-11-28T09:46:54Z")

</div>

No, this isn’t surprising - you have installed the `release` channel, not the `1.11.1` channel. Currently, the `release` channel provides you with version 1.11.1 as that is the latest release, if you want to remove that you have to `remove release`, not remove the specific version.

---

<div class="post-metadata">

### Author: ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)
#### Post date: [November 28, 2024, 10:06am UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/12 "2024-11-28T10:06:09Z")

</div>

Thank you! Maybe I already know what the problem is – I created the `config\startup.jl` file in the `C:\Users\myname\.julia` directory, following my previous usage habits. Now when I removed `config\startup.jl`, I found that Julia REPL in PowerShell worked fine.

But now the new question is, what is the proper way to configure the `startup.jl` file when using Juliaup?

---

<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: [November 28, 2024, 10:38am UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/13 "2024-11-28T10:38:41Z")

</div>

There’s no difference in the usage of `startup.jl` as far as I’m aware - this is where my `startup.jl` has always lived, before I started using `juliaup` and still does today.

If you do think it’s your startup that messes with the output you get from `Pkg` mode you should probably try to isolate the problem by starting with an empty startup file and adding things back in one-by-one.

---

<div class="post-metadata">

### Author: ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)
#### Post date: [November 28, 2024, 11:04am UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/14 "2024-11-28T11:04:55Z")

</div>

Good idea. I’ll have a try. 🤝

---

<div class="post-metadata">

### Author: ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)
#### Post date: [November 28, 2024, 11:13am UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/15 "2024-11-28T11:13:54Z")

</div>

The problem is in the following code of `startup.jl` (the `using OhMyREPL` part, to be precise), but I don’t know why. The `using Revise` part works well. And they all worked well on my old PC.

```julia
atreplinit() do repl
    try
        @eval using OhMyREPL
        println("`using OhMyREPL`\t ✔")
    catch e
        @warn "`using OhMyREPL`\t ✘" e
    end
    try
        @eval using Revise
        println("`using Revise`\t ✔")
    catch e
        @warn "`using Revise`\t ✘" e
    end
end

```

```julia
┌ Warning: `using OhMyREPL` ✘
│ e =
│ InitError: UndefRefError: access to undefined reference
│ during initialization of module REPLExt

```

---

<div class="post-metadata">

### Author: ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)
#### Post date: [November 28, 2024, 12:32pm UTC](https://discourse.julialang.org/t/packages-installed-in-vscode-disappeared-in-windows-powershell/123166/16 "2024-11-28T12:32:08Z")

</div>

This seems to be a 1.11 regression that only happens with a custom `JULIA_DEPOT_PATH`: [REPLExt: no method matching repl\_init(::REPL.LineEditREPL) when loading packages in REPL mode. · Issue #56216 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/56216)

On 1.11.1 I get the `repl_init` MethodError and then the Pkg REPL doesn’t work, unless I run `using Pkg` first.  
On the 1.11 release branch the MethodError goes away due to [REPLExt: check for compliant repl mode during repl init by IanButterworth · Pull Request #4067 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/pull/4067) but I still need to do `using Pkg` to get a functional Pkg REPL.

```julia
❯ julia +pr56658
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.11.1 (2024-11-22)
 _/ |\ __'_|_|_|\__'_| | topolarity:ct/revert-08d229f-1.11/79b1263b43 (fork: 530 commits, 286 days)
|__/ |

(@v1.11) pkg> st

(@v1.11) pkg> add Example

julia> using Pkg
Precompiling Pkg...
  13 dependencies successfully precompiled in 45 seconds. 10 already precompiled.
Precompiling REPLExt...
  1 dependency successfully precompiled in 6 seconds. 26 already precompiled.

(@v1.11) pkg> st
Status `A:\.julia\environments\v1.11\Project.toml`
  [9b6a8646] AllocCheck v0.2.0
  [6e4b80f9] BenchmarkTools v1.5.0
  [295af30f] Revise v3.6.4

julia> versioninfo()
Julia Version 1.11.1
Commit 79b1263b43 (2024-11-22 19:04 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 24 × 12th Gen Intel(R) Core(TM) i7-12800HX
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, alderlake)
Threads: 12 default, 0 interactive, 6 GC (on 24 virtual cores)
Environment:
  JULIA_DEPOT_PATH = a:\.julia
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 12
  JULIA_PKG_PRESERVE_TIERED_INSTALLED = true
  JULIA_PKG_USE_CLI_GIT = true
  JULIA_PROJECT = @.

```

I just switched to a custom `JULIA_DEPOT_PATH` since I moved it into Windows Dev Drive.  
Starting with `--startup=no` to avoid loading Revise and then precompiling the environment seems to have fixed this for me just now, I cannot reproduce the error anymore.
