Error in vscode in Windows when trying to use any package

I can’t understand this new error after updating to Julia v1.6. When I try in the REPL inside vscode a command like using Agents or even using Plots I receive the following message. This does not happen in vscode on my Mac. Only on Windows.
If I only use the REPL on Windows outside vscode there is no error.

julia> using Agents
[ Info: Precompiling Agents [46ada45e-f475-11e8-01d0-f70cc89e6671]
ERROR: LoadError: ArgumentError: Package MbedTLS_jll [c8ffd9c3-330d-5841-b78e-0817d7145fa1] is required but does not seem to be installed:
 - Run `Pkg.instantiate()` to install all recorded dependencies.

Stacktrace:
 [1] _require(::Base.PkgId) at .\loading.jl:999
 [2] require(::Base.PkgId) at .\loading.jl:928
 [3] require(::Module, ::Symbol) at .\loading.jl:923
 [4] include(::Function, ::Module, ::String) at .\Base.jl:380
 [5] include(::Module, ::String) at .\Base.jl:368
 [6] top-level scope at none:2
 [7] eval at .\boot.jl:331 [inlined]
 [8] eval(::Expr) at .\client.jl:467
 [9] top-level scope at .\none:3
in expression starting at C:\Users\sbac\.julia\packages\MbedTLS\4YY6E\src\MbedTLS.jl:3
ERROR: LoadError: LoadError: Failed to precompile MbedTLS [739be429-bea8-5141-9913-cc70e7f3736d] to C:\Users\sbac\.julia\compiled\v1.5\MbedTLS\bf9T0_rShTY.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1305
 [3] _require(::Base.PkgId) at .\loading.jl:1030
 [4] require(::Base.PkgId) at .\loading.jl:928
 [5] require(::Module, ::Symbol) at .\loading.jl:923
 [6] include(::Function, ::Module, ::String) at .\Base.jl:380
 [7] include at .\Base.jl:368 [inlined]
 [8] include(::String) at C:\Users\sbac\.julia\packages\HTTP\IAI92\src\HTTP.jl:1
 [9] top-level scope at C:\Users\sbac\.julia\packages\HTTP\IAI92\src\HTTP.jl:18
 [10] include(::Function, ::Module, ::String) at .\Base.jl:380
 [11] include(::Module, ::String) at .\Base.jl:368
 [12] top-level scope at none:2
 [13] eval at .\boot.jl:331 [inlined]
 [14] eval(::Expr) at .\client.jl:467
 [15] top-level scope at .\none:3
in expression starting at C:\Users\sbac\.julia\packages\HTTP\IAI92\src\IOExtras.jl:11
in expression starting at C:\Users\sbac\.julia\packages\HTTP\IAI92\src\HTTP.jl:18
ERROR: LoadError: Failed to precompile HTTP [cd3eb016-35fb-5094-929b-558a96fad6f3] to C:\Users\sbac\.julia\compiled\v1.5\HTTP\zXWya_rShTY.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1305
 [3] _require(::Base.PkgId) at .\loading.jl:1030
 [4] require(::Base.PkgId) at .\loading.jl:928
 [5] require(::Module, ::Symbol) at .\loading.jl:923
 [6] include(::Function, ::Module, ::String) at .\Base.jl:380
 [7] include(::Module, ::String) at .\Base.jl:368
 [8] top-level scope at none:2
 [9] eval at .\boot.jl:331 [inlined]
 [10] eval(::Expr) at .\client.jl:467
 [11] top-level scope at .\none:3
in expression starting at C:\Users\sbac\.julia\packages\OpenStreetMapX\pfbvr\src\OpenStreetMapX.jl:10
ERROR: LoadError: Failed to precompile OpenStreetMapX [86cd37e6-c0ff-550b-95fe-21d72c8d4fc9] to C:\Users\sbac\.julia\compiled\v1.5\OpenStreetMapX\3fbUy_rShTY.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1305
 [3] _require(::Base.PkgId) at .\loading.jl:1030
 [4] require(::Base.PkgId) at .\loading.jl:928
 [5] require(::Module, ::Symbol) at .\loading.jl:923
 [6] include(::Function, ::Module, ::String) at .\Base.jl:380
 [7] include(::Module, ::String) at .\Base.jl:368
 [8] top-level scope at none:2
 [9] eval at .\boot.jl:331 [inlined]
 [10] eval(::Expr) at .\client.jl:467
 [11] top-level scope at .\none:3
in expression starting at C:\Users\sbac\.julia\packages\Agents\G69lx\src\Agents.jl:8
ERROR: Failed to precompile Agents [46ada45e-f475-11e8-01d0-f70cc89e6671] to C:\Users\sbac\.julia\compiled\v1.5\Agents\nTsV8_rShTY.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1305
 [3] _require(::Base.PkgId) at .\loading.jl:1030
 [4] require(::Base.PkgId) at .\loading.jl:928
 [5] require(::Module, ::Symbol) at .\loading.jl:923
 [6] eval at .\boot.jl:331 [inlined]
 [7] eval at .\Base.jl:39 [inlined]
 [8] repleval(::Module, ::Expr, ::String) at c:\Users\sbac\.vscode\extensions\julialang.language-julia-1.1.38\scripts\packages\VSCodeServer\src\repl.jl:124
 [9] (::VSCodeServer.var"#47#49"{Module,Expr,REPL.LineEditREPL,REPL.LineEdit.Prompt})() at c:\Users\sbac\.vscode\extensions\julialang.language-julia-1.1.38\scripts\packages\VSCodeServer\src\repl.jl:99
 [10] with_logstate(::Function, ::Any) at .\logging.jl:408
 [11] with_logger at .\logging.jl:514 [inlined]
 [12] (::VSCodeServer.var"#46#48"{Module,Expr,REPL.LineEditREPL,REPL.LineEdit.Prompt})() at c:\Users\sbac\.vscode\extensions\julialang.language-julia-1.1.38\scripts\packages\VSCodeServer\src\repl.jl:100
 [13] #invokelatest#1 at .\essentials.jl:710 [inlined]
 [14] invokelatest(::Any) at .\essentials.jl:709
 [15] macro expansion at c:\Users\sbac\.vscode\extensions\julialang.language-julia-1.1.38\scripts\packages\VSCodeServer\src\eval.jl:34 [inlined]
 [16] (::VSCodeServer.var"#60#61")() at .\task.jl:356

Did you check which environment is active in the Julia REPL in VSCode? We’re automatically activating the first workspace dir if it’s a Julia env.
Also, did you try the suggested solution?

In vscode I got the message that I am in v1.6 environment. But in fact I keep receiving the message You opened a Julia package that is not part of your current environment. Do you want to activate a different environment?
I tried to do instantiate but without success as you can see:

(@v1.6) pkg> instantiate
ERROR: AssertionError: sourcepath !== nothing
Stacktrace:
 [1] is_package_downloaded at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1670 [inlined]
 [2] #12 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:113 [inlined]
 [3] _all(::Pkg.Operations.var"#12#13"{Pkg.Types.Context}, ::Array{Pkg.Types.PackageSpec,1}, ::Colon) at .\reduce.jl:828
 [4] #all#638 at .\reducedim.jl:735 [inlined]
 [5] all at .\reducedim.jl:735 [inlined]
 [6] is_instantiated at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:113 [inlined]
 [7] instantiate(::Pkg.Types.Context; manifest::Nothing, update_registry::Bool, verbose::Bool, platform::Pkg.BinaryPlatforms.Windows, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:829
 [8] instantiate(::Pkg.Types.Context) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:796
 [9] #instantiate#169 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:792 [inlined]
 [10] instantiate() at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:792
 [11] do_cmd!(::Pkg.REPLMode.Command, ::REPL.LineEditREPL) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\REPLMode\REPLMode.jl:401
 [12] do_cmd(::REPL.LineEditREPL, ::String; do_rethrow::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\REPLMode\REPLMode.jl:382
 [13] do_cmd at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\REPLMode\REPLMode.jl:377 [inlined]
 [14] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\REPLMode\REPLMode.jl:546
 [15] #invokelatest#1 at .\essentials.jl:710 [inlined]
 [16] invokelatest at .\essentials.jl:709 [inlined]
 [17] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\LineEdit.jl:2355
 [18] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:1144
 [19] (::REPL.var"#38#42"{REPL.LineEditREPL,REPL.REPLBackendRef})() at .\task.jl:356

You could try to update the project, it would then change the entries in the manifest to point to embedded jll lib inside 1.6 folder if this is one that would be needed? (There are new jll that are now embedded in 1.6 stdlibs that were not previously)

Right, you can’t use the same Manifest in Julia 1.6 and previous verisons.

On julia\environment I did mv v1.5 v1.6. Is this right?

Yes, even if cp -a v1.5 v1.6 would probably have been better (would have kept v1.5 project defaults packages). But anyway you need to to an update of the project, or alternatively rm -f v1.6/Manifest.toml then instantiate (only difference is that you would loose pined indications and deved packages)

Sorry, how can I update the project?

Either type ]up<Enter> (then <Backspace> to exit Pkg mode), or import Pkg; Pkg.update() should do the thing.

2 Likes

Sorry, I didn’t understood. Of course. Now it works! Thanks.