Failing to precompile external packages after upgrading to 1.6.0, but only when using an IDE

I recently upgraded to Julia 1.6.0, and everything is working fine when calling Julia from the command line. However, when using Julia within an IDE–whether VSCode, Atom/Juno, or Jupyter Lab–I get an EXCEPTION_ACCESS_VIOLATION error whenever I attempt to import a non-core package.

I am using Windows 10 Home version 20H2.

Steps to reproduce in VSCode:

  1. Install Julia 1.6.0, VSCode, and the Julia language extension.
  2. Install a Julia package, like ForwardDiff .
  3. Create or open a new Julia project in VSCode. In the example below, I ran Julia with the --project flag, but this doesn’t make a difference.
  4. Create a blank .jl file, type using ForwardDiff , and run it.

The error shown below appears.

julia> using ForwardDiff
[ Info: Precompiling ForwardDiff [f6369f11-7733-5829-9624-2563aa707210]

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x0 -- CESS_VIOLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x0 --  at 0x0 -- unknown function (ip: 0000000000000000)
in expression starting at C:\Users\Max\.julia\packages\ChainRulesCore\7d1hl\src\ChainRulesCore.jl:5
in expression starting at C:\Users\Max\.in expression starting at C:\Users\Max\.julia\packages\ChainRulesCore\7d1hl\src\ChainRulesCore.jl:5
ERROR: LoadError: Failed to precompile ChainRulesCore [d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4] to C:\Users\Max\.julia\compiled\v1.6\ChainRulesCore\jl_E773.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
    @ Base .\loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:901
  [7] include
    @ .\Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base .\loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ .\boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at C:\Users\Max\.julia\packages\SpecialFunctions\mFAQ4\src\SpecialFunctions.jl:1
ERROR: LoadError: Failed to precompile SpecialFunctions [276daf66-3868-5448-9aa4-cd146d93841b] to C:\Users\Max\.julia\compiled\v1.6\SpecialFunctions\jl_E476.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
    @ Base .\loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:901
  [7] include
    @ .\Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base .\loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ .\boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at C:\Users\Max\.julia\packages\ForwardDiff\sqhTO\src\ForwardDiff.jl:1
ERROR: Failed to precompile ForwardDiff [f6369f11-7733-5829-9624-2563aa707210] to C:\Users\Max\.julia\compiled\v1.6\ForwardDiff\jl_C295.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
    @ Base .\loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:901
  [7] eval
    @ .\boot.jl:360 [inlined]
  [8] eval
    @ .\Base.jl:39 [inlined]
  [9] repleval(m::Module, code::Expr, #unused#::String)
    @ VSCodeServer ~\.vscode\extensions\julialang.language-julia-1.1.38\scripts\packages\VSCodeServer\src\repl.jl:124
 [10] (::VSCodeServer.var"#47#49"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~\.vscode\extensions\julialang.language-julia-1.1.38\scripts\packages\VSCodeServer\src\repl.jl:99
 [11] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging .\logging.jl:491
 [12] with_logger
    @ .\logging.jl:603 [inlined]
 [13] (::VSCodeServer.var"#46#48"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~\.vscode\extensions\julialang.language-julia-1.1.38\scripts\packages\VSCodeServer\src\repl.jl:100
 [14] #invokelatest#2
    @ .\essentials.jl:708 [inlined]
 [15] invokelatest(::Any)
    @ Base .\essentials.jl:706
 [16] macro expansion
    @ ~\.vscode\extensions\julialang.language-julia-1.1.38\scripts\packages\VSCodeServer\src\eval.jl:34 [inlined]
 [17] (::VSCodeServer.var"#60#61")()
    @ VSCodeServer .\task.jl:406

I use VSCode version 1.55.2 and Julia VSCode version 1.1.38.

I submitted a bug report to Julia VSCode, but I am not sure if the problem is VSCode specific or not, because I have similar issues in Atom/Juno as I posted previously and in Jupyter Lab.

Has anyone else encountered this issue? What other details can I provide about my environment that might shed some light?


I have also tried calling Pkg.instantiate() as suggested here with no luck:

This issue has persisted for me after upgrading to 1.6.1.

Is there anything else I can try? I’m completely baffled. Julia 1.5.4 works just fine.

I might have run into the same issue as you, also using Windows 10. It also might be a completely different issue.

When I run into this issue, I first enter the Pkg environment (press ]) and then type resolve
This usually shows some package that I have never installed (recently XML2_jll) that is causing an issue. I then add that package (add XML2_jll) and then remove it (remove XML2_jll). After this, everything works for me. I am not sure why these packages are added but this fixes it for me.