Precompilation Error: GR

Hello, what is the problem?
Thank you…

? GR_jll
? Plots
? Plots → UnitfulExt
139 dependencies successfully precompiled in 94 seconds. 6 already precompiled.
1 dependency had output during precompilation:
GR
 ERROR: LoadError: InitError: could not load library "C:\Users\XXX\.julia\artifacts\ddbdc04695273554c21f01ae67218891b48b96c4\bin\Qt6Gui.dll"
 The specified procedure could not be found.
 Stacktrace:
   [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
     @ Base.Libc.Libdl .\libdl.jl:117
   [2] dlopen(s::String, flags::UInt32)
     @ Base.Libc.Libdl .\libdl.jl:116
   [3] macro expansion
     @ C:\Users\XXX\.julia\packages\JLLWrappers\pG9bm\src\products\library_generators.jl:63 [inlined]
   [4] __init__()
     @ Qt6Base_jll C:\Users\XXX\.julia\packages\Qt6Base_jll\fqleI\src\wrappers\x86_64-w64-mingw32-cxx11.jl:54
   [5] run_module_init(mod::Module, i::Int64)
     @ Base .\loading.jl:1134
   [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
     @ Base .\loading.jl:1122
   [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
     @ Base .\loading.jl:1067
   [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
     @ Base .\loading.jl:1581
   [9] _require(pkg::Base.PkgId, env::String)
     @ Base .\loading.jl:1938
  [10] __require_prelocked(uuidkey::Base.PkgId, env::String)
     @ Base .\loading.jl:1812
  [11] #invoke_in_world#3
     @ .\essentials.jl:926 [inlined]
  [12] invoke_in_world
     @ .\essentials.jl:923 [inlined]
  [13] _require_prelocked(uuidkey::Base.PkgId, env::String)
     @ Base .\loading.jl:1803
  [14] macro expansion
     @ .\loading.jl:1790 [inlined]
  [15] macro expansion
     @ .\lock.jl:267 [inlined]
  [16] __require(into::Module, mod::Symbol)
     @ Base .\loading.jl:1753
  [17] #invoke_in_world#3
     @ .\essentials.jl:926 [inlined]
  [18] invoke_in_world
     @ .\essentials.jl:923 [inlined]
  [19] require(into::Module, mod::Symbol)
     @ Base .\loading.jl:1746
  [20] include(mod::Module, _path::String)
     @ Base .\Base.jl:495
  [21] top-level scope
     @ C:\Users\XXX\.julia\packages\JLLWrappers\pG9bm\src\toplevel_generators.jl:192
  [22] include
     @ .\Base.jl:495 [inlined]
  [23] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, conc
     @ Base .\loading.jl:2222
  [24] top-level scope
     @ stdin:3
 during initialization of module Qt6Base_jll
 in expression starting at C:\Users\XXX\.julia\packages\GR_jll\0I7Qm\src\wrappers\x86_64-w64-mingw32-cxx11.jl:14
 in expression starting at C:\Users\XXX\.julia\packages\GR_jll\0I7Qm\src\GR_jll.jl:2
 in expression starting at stdin:3

3 dependencies errored.

Sysinfo:

Julia Version 1.10.1
Commit 7790d6f064 (2024-02-13 20:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, haswell)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)

Try this:
using Pkg
Pkg.build("GR_jll")
Then try running your code again, let me know what happens.

This works without errors…

julia> using Pkg

julia> Pkg.build("GR_jll")

julia>

but

julia> using Plots
Precompiling Plots
        Info Given Plots was explicitly requested, output will be shown live
ERROR: LoadError: InitError: UndefVarError: `GR_jll` not defined
Stacktrace:
  [1] __init__()
    @ GR.GRPreferences C:\Users\XXX\.julia\packages\GR\xEQ37\src\preferences.jl:64

Likely nothing, since Pkg.build does exactly nothing for JLL packages: the Pkg.build command executes the deps/build.jl script of a package, if it exists, which it doesn’t for JLL packages, their entire point is not to have that script at all.

1 Like

Please execute this and report all output.

using Pkg
pkg"add GR"
pkg"status"
using GR
using GR # repeat again if the first time fails
GR.GRPreferences.diagnostics()
julia> using Pkg

julia> pkg"add GR"
   Resolving package versions...
  No Changes to `C:\Users\XXX\.julia\environments\v1.10\Project.toml`
  No Changes to `C:\Users\XXX\.julia\environments\v1.10\Manifest.toml`
Precompiling project...
  ? Plots
  ? Plots → UnitfulExt
  0 dependencies successfully precompiled in 86 seconds. 145 already precompiled. 1 skipped during auto due to previous errors.
  2 dependencies errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

julia> pkg"status"
Status `C:\Users\XXX\.julia\environments\v1.10\Project.toml`
  [28b8d3ca] GR v0.73.2
  [91a5bcdd] Plots v1.40.1
  [d2c73de3] GR_jll v0.73.2+0

julia> using GR
ERROR: InitError: UndefVarError: `GR_jll` not defined
Stacktrace:
  [1] __init__()
    @ GR.GRPreferences C:\Users\XXX\.julia\packages\GR\xEQ37\src\preferences.jl:64
  [2] run_module_init(mod::Module, i::Int64)
    @ Base .\loading.jl:1134
  [3] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1122
  [4] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base .\loading.jl:1067
  [5] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base .\loading.jl:1581
  [6] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1938
  [7] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1812
  [8] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
  [9] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [10] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1803
 [11] macro expansion
    @ .\loading.jl:1790 [inlined]
 [12] macro expansion
    @ .\lock.jl:267 [inlined]
 [13] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1753
 [14] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [15] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [16] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1746
during initialization of module GRPreferences

julia> using GR

julia> GR.GRPreferences.diagnostics()
┌ Info: GRDIR Environment Variable
└   get(ENV, "GRDIR", missing) = missing
┌ Info: GR Preferences
│   binary = nothing
└   grdir = nothing
┌ Info: GR_jll Preferences
│   libGR_path = nothing
│   libGR3_path = nothing
│   libGRM_path = nothing
│   libGKS_path = nothing
│   gksqt_path = nothing
└   grplot_path = nothing
┌ Info: GR_jll Overrides.toml
│   overrides_toml_path = "C:\\Users\\XXX\\.julia\\artifacts\\Overrides.toml"
│   isfile(overrides_toml_path) = false
└   get(gr_jll_override_dict, "GR", nothing) = nothing
[ Info: GR_jll is not loaded
(binary = nothing, grdir = nothing, libGR_path = nothing, libGR3_path = nothing, libGRM_path = nothing, libGKS_path = nothing, gksqt_path = nothing, grplot_path = nothing, overrides_toml_path = "C:\\Users\\XXX\\.julia\\artifacts\\Overrides.toml", gr_jll_override_dict = Dict{String, Any}())

julia>

A few years ago I had a similar problem with Plots and GR on WIN7 64. The solution was MicrosoftEasyFix51044.msi. Everything was fine until yesterday when I added a new package (Gumbo, I guess it doesn’t matter). Plots was previously blocked by the Plots pin. Unfortunately


julia> using Plots
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
ERROR: LoadError: InitError: UndefVarError: GR_jll not defined
Stacktrace:
   [1] __init__()
     @GR.GRPreferences C:\Users\PC\.julia\packages\GR\yBe3g\src\preferences.jl:64
   [2] _include_from_serialized(pkg::Base.PkgId, path::String, depmods::Vector{Any})
     @Base .\loading.jl:831
   [3] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
     @Base .\loading.jl:1039
   [4] _require(pkg::Base.PkgId)
     @Base .\loading.jl:1315
   [5] _require_prelocked(uuidkey::Base.PkgId)
     @Base .\loading.jl:1200
   [6] macro expansion
     @ .\loading.jl:1180 [inlined]
   [7] macro expansion
     @ .\lock.jl:223 [inlined]
   [8] require(into::Module, mod::Symbol)
     @Base .\loading.jl:1144
   [9] top-level scope
     @ C:\Users\PC\.julia\packages\Plots\sxUvK\src\backends.jl:402
  [10] eval
     @ .\boot.jl:368 [inlined]
  [11] _initialize_backend(pkg::Plots.GRBackend)
     @ Plots C:\Users\PC\.julia\packages\Plots\sxUvK\src\backends.jl:401
  [12] backend(pkg::Plots.GRBackend)
     @ Plots C:\Users\PC\.julia\packages\Plots\sxUvK\src\backends.jl:266
  [13] backend(sym::Symbol)
     @Plots C:\Users\PC\.julia\packages\Plots\sxUvK\src\backends.jl:276
  [14] load_default_backend()
     @ Plots C:\Users\PC\.julia\packages\Plots\sxUvK\src\backends.jl:207
  [15] backend()
     @ Plots C:\Users\PC\.julia\packages\Plots\sxUvK\src\backends.jl:254
  [16] top-level scope
     @ C:\Users\PC\.julia\packages\Plots\sxUvK\src\init.jl:83
  [17] include(mod::Module, _path::String)
     @Base.\Base.jl:419
  [18] include(x::String)
     @ Plots C:\Users\PC\.julia\packages\Plots\sxUvK\src\Plots.jl:1
  [19] top-level scope
     @ C:\Users\PC\.julia\packages\Plots\sxUvK\src\Plots.jl:176
  [20] include
     @ .\Base.jl:419 [inlined]
  [21] 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:1554
  [22] top-level scope
     @stdin:1
during initialization of module GRPreferences
in expression starting at C:\Users\PC\.julia\packages\Plots\sxUvK\src\init.jl:83
in expression starting at C:\Users\PC\.julia\packages\Plots\sxUvK\src\Plots.jl:1
in expression starting at stdin:1
ERROR: Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to C:\Users\PC\.julia\compiled\v1.8\Plot
s\jl_F828.tmp.
Stacktrace:
  [1] error(s::String)
    @Base .\error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::B
ool)
    @Base .\loading.jl:1707
  [3] compilecache
    @ .\loading.jl:1651 [inlined]
  [4] _require(pkg::Base.PkgId)
    @Base .\loading.jl:1337
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @Base .\loading.jl:1200
  [6] macro expansion
    @ .\loading.jl:1180 [inlined]
  [7] macro expansion
    @ .\lock.jl:223 [inlined]
  [8] require(into::Module, mod::Symbol)
    @Base .\loading.jl:1144
I have already done all possible repairs of GR, GR_jll, etc., what's next?

Currently Julia 1.8.5
Paul

Please execute rhe followings and reporr all output.

using Pkg
ENV["JULIA_DEBUG"] = "GR"
pkg"add GR"
pkg"status"
using GR
using GR # repeat again if the first time fails
GR.GRPreferences.diagnostics()
pkg"add GR_jll"
using GR_jll

See additional diagnostic information at end of the README

Ome potential fix of last resort is the following.

using GR # repeat this if there is an error
GR.GRPreferences.use_upstream_binary(; force = true)

To undo, do the following.

using GR # repeat this if there is an error
GR.GRPreferences.use_jll_binary(; force = true)

At the moment

julia> GR.GRPreferences.diagnostics()
ERROR: UndefVarError: GRPreferences not defined
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base .\Base.jl:31
 [2] top-level scope
   @ REPL[6]:1

And after

julia> pkg"add GR_jll"
  Downloaded artifact: Qt6Base
    Updating `C:\Users\PC\.julia\environments\v1.8\Project.toml`
  [d2c73de3] + GR_jll v0.73.3+0
    Updating `C:\Users\PC\.julia\environments\v1.8\Manifest.toml`
  [0656b61e] + GLFW_jll v3.3.9+0
  [d2c73de3] + GR_jll v0.73.3+0
^ [c0090381] + Qt6Base_jll v6.5.2+2
  [a44049a8] + Vulkan_Loader_jll v1.3.243+0
  [f67eecfb] + Xorg_libICE_jll v1.0.10+1
  [c834827a] + Xorg_libSM_jll v1.2.3+0
  [e920d4aa] + Xorg_xcb_util_cursor_jll v0.1.4+0
  [12413925] + Xorg_xcb_util_image_jll v0.4.0+1
  [2def613f] + Xorg_xcb_util_jll v0.4.0+1
  [975044d2] + Xorg_xcb_util_keysyms_jll v0.4.0+1
  [0d47668e] + Xorg_xcb_util_renderutil_jll v0.3.9+1
  [c22f9ab0] + Xorg_xcb_util_wm_jll v0.4.1+1
  [35ca27e7] + eudev_jll v3.2.9+0
  [1a1c6b14] + gperf_jll v3.1.1+0
  [2db6ffa8] + libevdev_jll v1.11.0+0
  [36db933b] + libinput_jll v1.18.0+0
  [009596ad] + mtdev_jll v1.1.6+0
        Info Packages marked with ^ have new versions available and may be upgradable.
Precompiling project...
  ? GR_jll
  1 dependency successfully precompiled in 5 seconds. 342 already precompiled. 9 skipped during auto due t
ous errors.
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

julia> using GR_jll
[ Info: Precompiling GR_jll [d2c73de3-f751-5644-a686-071e5b155ba9]
ERROR: LoadError: InitError: could not load library "C:\Users\PC\.julia\artifacts\2ef92b843c5dee978e2aaf84
2c09dc731\bin\Qt6Concurrent.dll"
Nie można odnaleźć określonej procedury.
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl .\libdl.jl:117
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl .\libdl.jl:116
  [3] macro expansion
    @ C:\Users\PC\.julia\packages\JLLWrappers\pG9bm\src\products\library_generators.jl:63 [inlined]
  [4] __init__()
    @ Qt6Base_jll C:\Users\PC\.julia\packages\Qt6Base_jll\YAh2B\src\wrappers\x86_64-w64-mingw32-cxx11.jl:3
  [5] _include_from_serialized(pkg::Base.PkgId, path::String, depmods::Vector{Any})
    @ Base .\loading.jl:831
  [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
    @ Base .\loading.jl:1039
  [7] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1315
  [8] _require_prelocked(uuidkey::Base.PkgId)
    @ Base .\loading.jl:1200
  [9] macro expansion
    @ .\loading.jl:1180 [inlined]
 [10] macro expansion
    @ .\lock.jl:223 [inlined]
 [11] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1144
 [12] include(mod::Module, _path::String)
    @ Base .\Base.jl:419
 [13] top-level scope
    @ C:\Users\PC\.julia\packages\JLLWrappers\pG9bm\src\toplevel_generators.jl:192
 [14] include
    @ .\Base.jl:419 [inlined]
 [15] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path:
{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base .\loading.jl:1554
 [16] top-level scope
    @ stdin:1
during initialization of module Qt6Base_jll
in expression starting at C:\Users\PC\.julia\packages\GR_jll\JpW5O\src\wrappers\x86_64-w64-mingw32-cxx11.j
in expression starting at C:\Users\PC\.julia\packages\GR_jll\JpW5O\src\GR_jll.jl:2
in expression starting at stdin:1
ERROR: Failed to precompile GR_jll [d2c73de3-f751-5644-a686-071e5b155ba9] to C:\Users\PC\.julia\compiled\v
jll\jl_4793.tmp.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_mod
ool)
   @ Base .\loading.jl:1707
 [3] compilecache
   @ .\loading.jl:1651 [inlined]
 [4] _require(pkg::Base.PkgId)
   @ Base .\loading.jl:1337
 [5] _require_prelocked(uuidkey::Base.PkgId)
   @ Base .\loading.jl:1200
 [6] macro expansion
   @ .\loading.jl:1180 [inlined]
 [7] macro expansion
   @ .\lock.jl:223 [inlined]
 [8] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1144


Paul

What is the output of the following.

using Pkg
pkg"status GR"
pkg"status Plots"
versioninfo()

There seems to be an issue with QT6 on your machine. Either we need to try to downgrade GR_jll, upgrade it, or try the upstream binaries.

@mkitti it’d be better to not suggest pkg"..." commands, as that’s not public API and subject to possible breakage in the future.

Pkg.status(["GR", "Plots"])

is even shorter than

pkg"status GR"
pkg"status Plots"
julia> pkg"status GR"
No Matches in `C:\Users\PC\.julia\environments\v1.10\Project.toml`

julia> pkg"status Plots"
Status `C:\Users\PC\.julia\environments\v1.10\Project.toml`
  [91a5bcdd] Plots v1.40.2

julia> versioninfo()
Julia Version 1.10.2
Commit bd47eca2c8 (2024-03-01 10:14 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, sandybridge)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)

path shell … etc. .are clean !

(@v1.10) pkg> build GR_jll


(@v1.10) pkg> precompile
Precompiling project...
  ? GR_jll
  ? Plots
  ? Plots → UnitfulExt
  0 dependencies successfully precompiled in 30 seconds. 161 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]

Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to "C:\\Users\\PC\\.julia\\compiled\\v1.10\\Plots
\\jl_3441.tmp".
ERROR: LoadError: InitError: UndefVarError: `GR_jll` not defined
Stacktrace:
  [1] __init__()
    @ GR.GRPreferences C:\Users\PC\.julia\packages\GR\SdanO\src\preferences.jl:64
  [2] run_module_init(mod::Module, i::Int64)
    @ Base .\loading.jl:1134
  [3] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1122
  [4] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base .\loading.jl:1067
  [5] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base .\loading.jl:1581
  [6] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1938
  [7] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1812
  [8] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
  [9] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [10] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1803
 [11] macro expansion
    @ .\loading.jl:1790 [inlined]
 [12] macro expansion
    @ .\lock.jl:267 [inlined]
 [13] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1753
 [14] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [15] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [16] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1746
 [17] top-level scope
    @ C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:380
 [18] eval
    @ .\boot.jl:385 [inlined]
 [19] _initialize_backend(pkg::Plots.GRBackend)
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:379
 [20] backend(pkg::Plots.GRBackend)
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:244
 [21] backend(sym::Symbol)
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:254
 [22] load_default_backend()
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:201
 [23] backend()
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:232
 [24] top-level scope
    @ C:\Users\PC\.julia\packages\Plots\a3u1v\src\init.jl:91
 [25] include(mod::Module, _path::String)
    @ Base .\Base.jl:495
 [26] include(x::String)
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\Plots.jl:1
 [27] top-level scope
    @ C:\Users\PC\.julia\packages\Plots\a3u1v\src\Plots.jl:176
 [28] include
    @ .\Base.jl:495 [inlined]
 [29] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{S
tring}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base .\loading.jl:2222
 [30] top-level scope
    @ stdin:3
during initialization of module GRPreferences
in expression starting at C:\Users\PC\.julia\packages\Plots\a3u1v\src\init.jl:91
in expression starting at C:\Users\PC\.julia\packages\Plots\a3u1v\src\Plots.jl:1
in expression starting at stdin:

(@v1.10) pkg>

Paul

Could you do the following?

using Pkg
Pkg.status(["GR", "GR_jll", "Plots", "Qt6Base_jll"], mode = Pkg.PKGMODE_MANIFEST)

Also try to see if this works in a new Julia session.

using Pkg
Pkg.activate("plotstest", shared=true)
Pkg.add("Plots")
using Plots
plot(1:5)

Thx for Your respons.

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.2 (2024-03-01)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Pkg

julia> Pkg.status(["GR", "GR_jll", "Plots", "Qt6Base_jll"], mode = Pkg.PKGMODE_MANIFEST)
Status `C:\Users\PC\.julia\environments\v1.10\Manifest.toml`
  [28b8d3ca] GR v0.73.3
  [91a5bcdd] Plots v1.40.2
  [d2c73de3] GR_jll v0.73.3+0
^ [c0090381] Qt6Base_jll v6.5.2+2
Info Packages marked with ^ have new versions available and may be upgradable.

julia> using Pkg

julia> Pkg.activate("plotstest", shared=true)
  Activating project at `C:\Users\PC\.julia\environments\plotstest`

julia> Pkg.add("Plots")
   Resolving package versions...
  No Changes to `C:\Users\PC\.julia\environments\plotstest\Project.toml`
  No Changes to `C:\Users\PC\.julia\environments\plotstest\Manifest.toml`

julia> using Plots
Precompiling Plots
        Info Given Plots was explicitly requested, output will be shown live
ERROR: LoadError: InitError: UndefVarError: `GR_jll` not defined
Stacktrace:
  [1] __init__()
    @ GR.GRPreferences C:\Users\PC\.julia\packages\GR\SdanO\src\preferences.jl:64
  [2] run_module_init(mod::Module, i::Int64)
    @ Base .\loading.jl:1134
  [3] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1122
  [4] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base .\loading.jl:1067
  [5] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base .\loading.jl:1581
  [6] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1938
  [7] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1812
  [8] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
  [9] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [10] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1803
 [11] macro expansion
    @ .\loading.jl:1790 [inlined]
 [12] macro expansion
    @ .\lock.jl:267 [inlined]
 [13] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1753
 [14] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [15] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [16] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1746
 [17] top-level scope
    @ C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:380
 [18] eval
    @ .\boot.jl:385 [inlined]
 [19] _initialize_backend(pkg::Plots.GRBackend)
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:379
 [20] backend(pkg::Plots.GRBackend)
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:244
 [21] backend(sym::Symbol)
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:254
 [22] load_default_backend()
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:201
 [23] backend()
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:232
 [24] top-level scope
    @ C:\Users\PC\.julia\packages\Plots\a3u1v\src\init.jl:91
 [25] include(mod::Module, _path::String)
    @ Base .\Base.jl:495
 [26] include(x::String)
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\Plots.jl:1
 [27] top-level scope
    @ C:\Users\PC\.julia\packages\Plots\a3u1v\src\Plots.jl:176
 [28] include
    @ .\Base.jl:495 [inlined]
 [29] 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, UInt128}}, source::Nothing)
    @ Base .\loading.jl:2222
 [30] top-level scope
    @ stdin:3
during initialization of module GRPreferences
in expression starting at C:\Users\PC\.julia\packages\Plots\a3u1v\src\init.jl:91
in expression starting at C:\Users\PC\.julia\packages\Plots\a3u1v\src\Plots.jl:1
in expression starting at stdin:3
  ? GR_jll
  ? Plots
  ? Plots → UnitfulExt
  0 dependencies successfully precompiled in 34 seconds. 145 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]

Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to "C:\\Users\\PC\\.julia\\compiled\\v1.10\\Plots\\jl_9722.tmp".
ERROR: LoadError: InitError: UndefVarError: `GR_jll` not defined
Stacktrace:
  [1] __init__()
    @ GR.GRPreferences C:\Users\PC\.julia\packages\GR\SdanO\src\preferences.jl:64
  [2] run_module_init(mod::Module, i::Int64)
    @ Base .\loading.jl:1134
  [3] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1122
  [4] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base .\loading.jl:1067
  [5] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base .\loading.jl:1581
  [6] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1938
  [7] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1812
  [8] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
  [9] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [10] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1803
 [11] macro expansion
    @ .\loading.jl:1790 [inlined]
 [12] macro expansion
    @ .\lock.jl:267 [inlined]
 [13] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1753
 [14] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [15] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [16] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1746
 [17] top-level scope
    @ C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:380
 [18] eval
    @ .\boot.jl:385 [inlined]
 [19] _initialize_backend(pkg::Plots.GRBackend)
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:379
 [20] backend(pkg::Plots.GRBackend)
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:244
 [21] backend(sym::Symbol)
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:254
 [22] load_default_backend()
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:201
 [23] backend()
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\backends.jl:232
 [24] top-level scope
    @ C:\Users\PC\.julia\packages\Plots\a3u1v\src\init.jl:91
 [25] include(mod::Module, _path::String)
    @ Base .\Base.jl:495
 [26] include(x::String)
    @ Plots C:\Users\PC\.julia\packages\Plots\a3u1v\src\Plots.jl:1
 [27] top-level scope
    @ C:\Users\PC\.julia\packages\Plots\a3u1v\src\Plots.jl:176
 [28] include
    @ .\Base.jl:495 [inlined]
 [29] 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, UInt128}}, source::Nothing)
    @ Base .\loading.jl:2222
 [30] top-level scope
    @ stdin:3
during initialization of module GRPreferences
in expression starting at C:\Users\PC\.julia\packages\Plots\a3u1v\src\init.jl:91
in expression starting at C:\Users\PC\.julia\packages\Plots\a3u1v\src\Plots.jl:1
in expression starting at stdin:
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types C:\Users\PC\AppData\Local\Programs\Julia-1.10.2\share\julia\stdlib\v1.10\Pkg\src\Types.jl:70
  [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, _from_loading::Bool, kwargs::@Kwargs{io::Base.TTY})
    @ Pkg.API C:\Users\PC\AppData\Local\Programs\Julia-1.10.2\share\julia\stdlib\v1.10\Pkg\src\API.jl:1659
  [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{_from_loading::Bool})
    @ Pkg.API C:\Users\PC\AppData\Local\Programs\Julia-1.10.2\share\julia\stdlib\v1.10\Pkg\src\API.jl:159
  [4] precompile
    @ C:\Users\PC\AppData\Local\Programs\Julia-1.10.2\share\julia\stdlib\v1.10\Pkg\src\API.jl:147 [inlined]
  [5] #precompile#114
    @ C:\Users\PC\AppData\Local\Programs\Julia-1.10.2\share\julia\stdlib\v1.10\Pkg\src\API.jl:146 [inlined]
  [6] #invokelatest#2
    @ .\essentials.jl:894 [inlined]
  [7] invokelatest
    @ .\essentials.jl:889 [inlined]
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1963
  [9] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1812
 [10] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [11] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [12] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1803
 [13] macro expansion
    @ .\loading.jl:1790 [inlined]
 [14] macro expansion
    @ .\lock.jl:267 [inlined]
 [15] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1753
 [16] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [17] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [18] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1746

julia> plot(1:5)
ERROR: UndefVarError: `plot` not defined
Stacktrace:
 [1] top-level scope
   @ REPL[7]:1

julia>

Paul

You must have run the second set of commands previously. One of the things I wanted to test was if upgrading Qt6Base_jll would help, but I cannot see the version above.

Could you run the following to see if it is upgraded on the new environment?

using Pkg
Pkg.activate("plotstest", shared=true)
Pkg.status(["GR", "GR_jll", "Plots", "Qt6Base_jll"], mode = Pkg.PKGMODE_MANIFEST)

Ultimately this is going to come down to why "C:\Users\PC\.julia\artifacts\2ef92b843c5dee978e2aaf842c09dc731\bin\Qt6Concurrent.dll" does not want to load. That will require some low level debugging.

Like this :

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.2 (2024-03-01)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Pkg

julia> Pkg.activate("plotstest", shared=true)
  Activating project at `C:\Users\PC\.julia\environments\plotstest`

julia> Pkg.status(["GR", "GR_jll", "Plots", "Qt6Base_jll"], mode = Pkg.PKGMODE_MANIFEST)
Status `C:\Users\PC\.julia\environments\plotstest\Manifest.toml`
  [28b8d3ca] GR v0.73.3
  [91a5bcdd] Plots v1.40.2
  [d2c73de3] GR_jll v0.73.3+0
  [c0090381] Qt6Base_jll v6.5.3+1

julia>

My next step would be to try to use GitHub - lucasg/Dependencies: A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues. to figure out what “C:\Users\PC.julia\artifacts\2ef92b843c5dee978e2aaf842c09dc731\bin\Qt6Concurrent.dll” is missing.

julia> using Qt6Base_jll, DependencyWalker

julia> Library(Qt6Base_jll.libqt6concurrent_path)
◼ C:\Users\mkitti\.julia\artifacts\ddbdc04695273554c21f01ae67218891b48b96c4\bin\Qt6Concurrent.dll
  ◼ C:\Users\mkitti\.julia\artifacts\ddbdc04695273554c21f01ae67218891b48b96c4\bin\Qt6Core.dll
    ◼ C:\windows\System32\ole32.dll
      ◼ C:\windows\System32\RPCRT4.dll
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\combase.dll
        ◼ C:\windows\System32\RPCRT4.dll
          ◼ C:\windows\System32\KERNELBASE.dll
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\GDI32.dll
      ◼ C:\windows\System32\KERNEL32.DLL
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\USER32.dll
        ◼ C:\windows\System32\KERNELBASE.dll
        ◼ C:\windows\System32\GDI32.dll
      ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\windows\SYSTEM32\MPR.dll
    ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libwinpthread-1.dll
      ◼ C:\windows\System32\msvcrt.dll
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\KERNEL32.DLL
        ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libgcc_s_seh-1.dll
      ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libwinpthread-1.dll
        ◼ C:\windows\System32\msvcrt.dll
          ◼ C:\windows\System32\KERNELBASE.dll
        ◼ C:\windows\System32\KERNEL32.DLL
          ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\msvcrt.dll
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\KERNEL32.DLL
        ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libstdc++-6.dll
      ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libwinpthread-1.dll
        ◼ C:\windows\System32\msvcrt.dll
          ◼ C:\windows\System32\KERNELBASE.dll
        ◼ C:\windows\System32\KERNEL32.DLL
          ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libgcc_s_seh-1.dll
        ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libwinpthread-1.dll
          ◼ C:\windows\System32\msvcrt.dll
            ◼ C:\windows\System32\KERNELBASE.dll
          ◼ C:\windows\System32\KERNEL32.DLL
            ◼ C:\windows\System32\KERNELBASE.dll
        ◼ C:\windows\System32\msvcrt.dll
          ◼ C:\windows\System32\KERNELBASE.dll
        ◼ C:\windows\System32\KERNEL32.DLL
          ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\msvcrt.dll
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\KERNEL32.DLL
        ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\windows\System32\USER32.dll
      ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\GDI32.dll
    ◼ C:\windows\SYSTEM32\AUTHZ.dll
    ◼ C:\windows\System32\msvcrt.dll
      ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\windows\System32\KERNEL32.DLL
      ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\windows\System32\ADVAPI32.dll
      ◼ C:\windows\System32\KERNEL32.DLL
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\RPCRT4.dll
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\msvcrt.dll
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\sechost.dll
        ◼ C:\windows\System32\RPCRT4.dll
          ◼ C:\windows\System32\KERNELBASE.dll
        ◼ C:\windows\System32\bcrypt.dll
    ◼ C:\windows\System32\SHELL32.dll
      ◼ C:\windows\System32\msvcp_win.dll
      ◼ C:\windows\System32\GDI32.dll
      ◼ C:\windows\System32\USER32.dll
        ◼ C:\windows\System32\KERNELBASE.dll
        ◼ C:\windows\System32\GDI32.dll
      ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\windows\SYSTEM32\USERENV.dll
      ◼ C:\windows\System32\RPCRT4.dll
        ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\windows\SYSTEM32\WINMM.dll
      ◼ C:\windows\System32\msvcrt.dll
        ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\windows\System32\WS2_32.dll
      ◼ C:\windows\System32\RPCRT4.dll
        ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\windows\SYSTEM32\VERSION.dll
      ◼ C:\windows\System32\KERNEL32.DLL
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\msvcrt.dll
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\windows\SYSTEM32\NETAPI32.dll
      ◼ C:\windows\System32\msvcrt.dll
        ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libz.dll
      ◼ C:\windows\System32\msvcrt.dll
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\KERNEL32.DLL
        ◼ C:\windows\System32\KERNELBASE.dll
  ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libgcc_s_seh-1.dll
    ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libwinpthread-1.dll
      ◼ C:\windows\System32\msvcrt.dll
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\KERNEL32.DLL
        ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\windows\System32\msvcrt.dll
      ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\windows\System32\KERNEL32.DLL
      ◼ C:\windows\System32\KERNELBASE.dll
  ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libstdc++-6.dll
    ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libwinpthread-1.dll
      ◼ C:\windows\System32\msvcrt.dll
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\KERNEL32.DLL
        ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libgcc_s_seh-1.dll
      ◼ C:\Users\mkitti\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\bin\libwinpthread-1.dll
        ◼ C:\windows\System32\msvcrt.dll
          ◼ C:\windows\System32\KERNELBASE.dll
        ◼ C:\windows\System32\KERNEL32.DLL
          ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\msvcrt.dll
        ◼ C:\windows\System32\KERNELBASE.dll
      ◼ C:\windows\System32\KERNEL32.DLL
        ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\windows\System32\msvcrt.dll
      ◼ C:\windows\System32\KERNELBASE.dll
    ◼ C:\windows\System32\KERNEL32.DLL
      ◼ C:\windows\System32\KERNELBASE.dll
  ◼ C:\windows\System32\msvcrt.dll
    ◼ C:\windows\System32\KERNELBASE.dll
  ◼ C:\windows\System32\KERNEL32.DLL
    ◼ C:\windows\System32\KERNELBASE.dll