How to solve this error? About Pkg.jl and Plots.jl

import Pkg
Pkg.build(“Plots”)
import CSV
import DataFrames
import Plots

const DATA_DIR = joinpath(@DIR, “.julia\data_julia”)
water_place = CSV.read(joinpath(DATA_DIR,“water_place.csv”), DataFrames.DataFrame)
Plots.scatter(
water_place.place,
water_place.total_water_resources;
xlabel = “place”,
ylabel = “Height”,
)

Error:

julia> import Pkg

julia> Pkg.build(“Plots”)
Building GR → C:\Users\allll\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\cf0a9940f250dc3cb6cc6c6821b4bf8a4286cf9c\build.log
Precompiling project…
✓ GR
✓ Plots
2 dependencies successfully precompiled in 89 seconds. 276 already precompiled. 1 skipped during auto due to previous errors.
2 dependencies precompiled but different versions are currently loaded. Restart julia to access the new versions

After I run scatter:

julia> Plots.scatter(
water_place.place,
water_place.total_water_resources;
xlabel = “place”,
ylabel = “Height”,
)
[ Info: Precompiling GR_jll [d2c73de3-f751-5644-a686-071e5b155ba9]
ERROR: LoadError: InitError: could not load library “C:\Users\allll.julia\artifacts\c3712e14d6f387fa0a6d1509acbdd4b8976e87d1\bin\Qt5Concurrent.dll”
The specified module 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\allll.julia\packages\JLLWrappers\QpMQW\src\products\library_generators.jl:54 [inlined]
[4] init()
@ Qt5Base_jll C:\Users\allll.julia\packages\Qt5Base_jll\lpIK6\src\wrappers\x86_64-w64-mingw32-cxx11.jl:31
[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\allll.julia\packages\JLLWrappers\QpMQW\src\toplevel_generators.jl:188
[14] include
@ .\Base.jl:419 [inlined]
[15] 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
[16] top-level scope
@ stdin:1
during initialization of module Qt5Base_jll
in expression starting at C:\Users\allll.julia\packages\GR_jll\k8I6U\src\wrappers\x86_64-w64-mingw32-cxx11.jl:13
in expression starting at C:\Users\allll.julia\packages\GR_jll\k8I6U\src\GR_jll.jl:2
in expression starting at stdin:1
┌ Error: Error importing GR_jll:
│ exception =
│ Failed to precompile GR_jll [d2c73de3-f751-5644-a686-071e5b155ba9] to C:\Users\allll.julia\compiled\v1.8\GR_jll\jl_12D6.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::Bool)
│ @ Base .\loading.jl:1705
│ [3] compilecache
│ @ .\loading.jl:1649 [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
│ [9] eval
│ @ .\boot.jl:368 [inlined]
│ [10] load_libs(always::Bool)
│ @ GR C:\Users\allll.julia\packages\GR\uG7UO\src\funcptrs.jl:32
│ [11] get_func_ptr
│ @ C:\Users\allll.julia\packages\GR\uG7UO\src\funcptrs.jl:73 [inlined]
│ [12] get_func_ptr
│ @ C:\Users\allll.julia\packages\GR\uG7UO\src\funcptrs.jl:72 [inlined]
│ [13] libGR_ptr
│ @ C:\Users\allll.julia\packages\GR\uG7UO\src\funcptrs.jl:83 [inlined]
│ [14] setcharheight(height::Float64)
│ @ GR C:\Users\allll.julia\packages\GR\uG7UO\src\GR.jl:1668
│ [15] gr_set_font(f::Plots.Font, s::Plots.Subplot{Plots.GRBackend}; halign::Symbol, valign::Symbol, color::ColorTypes.RGB{FixedPointNumbers.N0f8}, rotation::Int64)
│ @ Plots C:\Users\allll.julia\packages\Plots\gl4j3\src\backends\gr.jl:437
│ [16] gr_set_tickfont(sp::Plots.Subplot{Plots.GRBackend}, letter::Symbol)
│ @ Plots C:\Users\allll.julia\packages\Plots\gl4j3\src\backends\gr.jl:707
│ [17] _update_min_padding!(sp::Plots.Subplot{Plots.GRBackend})
│ @ Plots C:\Users\allll.julia\packages\Plots\gl4j3\src\backends\gr.jl:919
│ [18] iterate
│ @ .\generator.jl:47 [inlined]
│ [19] _collect(c::Matrix{RecipesBase.AbstractLayout}, itr::Base.Generator{Matrix{RecipesBase.AbstractLayout}, typeof(Plots._update_min_padding!)}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{2})
│ @ Base .\array.jl:807
│ [20] collect_similar
│ @ .\array.jl:716 [inlined]
│ [21] map
│ @ .\abstractarray.jl:2933 [inlined]
│ [22] _update_min_padding!(layout::Plots.GridLayout)
│ @ Plots C:\Users\allll.julia\packages\Plots\gl4j3\src\layouts.jl:287
│ [23] prepare_output(plt::Plots.Plot{Plots.GRBackend})
│ @ Plots C:\Users\allll.julia\packages\Plots\gl4j3\src\plot.jl:247
│ [24] show
│ @ C:\Users\allll.julia\packages\Plots\gl4j3\src\output.jl:226 [inlined]
│ [25] __binrepr(m::MIME{Symbol(“image/svg+xml”)}, x::Plots.Plot{Plots.GRBackend}, context::Nothing)
│ @ Base.Multimedia .\multimedia.jl:159
│ [26] display(d::VSCodeServer.InlineDisplay, m::MIME{Symbol(“image/svg+xml”)}, x::Plots.Plot{Plots.GRBackend})
│ @ VSCodeServer c:\Users\allll.vscode\extensions\julialang.language-julia-1.7.12\scripts\packages\VSCodeServer\src\display.jl:0
│ [27] display(d::VSCodeServer.InlineDisplay, mime::String, x::Any)
│ @ Base.Multimedia .\multimedia.jl:216
│ [28] display(d::VSCodeServer.InlineDisplay, x::Plots.Plot{Plots.GRBackend})
│ @ VSCodeServer c:\Users\allll.vscode\extensions\julialang.language-julia-1.7.12\scripts\packages\VSCodeServer\src\display.jl:165
│ [29] display(x::Any)
│ @ Base.Multimedia .\multimedia.jl:328
│ [30] #invokelatest#2
│ @ .\essentials.jl:729 [inlined]
│ [31] invokelatest
│ @ .\essentials.jl:726 [inlined]
│ [32] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
│ @ REPL C:\Users\allll\AppData\Local\Programs\Julia-1.8.1\share\julia\stdlib\v1.8\REPL\src\REPL.jl:296
│ [33] (::REPL.var"#45#46"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
│ @ REPL C:\Users\allll\AppData\Local\Programs\Julia-1.8.1\share\julia\stdlib\v1.8\REPL\src\REPL.jl:278
│ [34] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
│ @ REPL C:\Users\allll\AppData\Local\Programs\Julia-1.8.1\share\julia\stdlib\v1.8\REPL\src\REPL.jl:521
│ [35] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
│ @ REPL C:\Users\allll\AppData\Local\Programs\Julia-1.8.1\share\julia\stdlib\v1.8\REPL\src\REPL.jl:276
│ [36] (::REPL.var"#do_respond#66"{Bool, Bool, REPL.var"#77#87"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
│ @ REPL C:\Users\allll\AppData\Local\Programs\Julia-1.8.1\share\julia\stdlib\v1.8\REPL\src\REPL.jl:857
│ [37] (::VSCodeServer.var"#98#101"{REPL.var"#do_respond#66"{Bool, Bool, REPL.var"#77#87"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt}})(mi::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
│ @ VSCodeServer c:\Users\allll.vscode\extensions\julialang.language-julia-1.7.12\scripts\packages\VSCodeServer\src\repl.jl:122
│ [38] #invokelatest#2
│ @ .\essentials.jl:729 [inlined]
│ [39] invokelatest
│ @ .\essentials.jl:726 [inlined]
│ [40] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
│ @ REPL.LineEdit C:\Users\allll\AppData\Local\Programs\Julia-1.8.1\share\julia\stdlib\v1.8\REPL\src\LineEdit.jl:2510
│ [41] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
│ @ REPL C:\Users\allll\AppData\Local\Programs\Julia-1.8.1\share\julia\stdlib\v1.8\REPL\src\REPL.jl:1248
│ [42] (::REPL.var"#49#54"{REPL.LineEditREPL, REPL.REPLBackendRef})()
│ @ REPL .\task.jl:484
└ @ GR C:\Users\allll.julia\packages\GR\uG7UO\src\funcptrs.jl:38
Your GR installation is incomplete. Rerunning build step for GR package.
┌ Info: Switching provider to GR due to error in depsfile
└ depsfile = “C:\Users\allll\.julia\packages\GR\uG7UO\deps\deps.jl”
┌ Info: Emptying depsfile. GR provider is GR
│ provider = “GR”
└ depsfile = “C:\Users\allll\.julia\packages\GR\uG7UO\deps\deps.jl”
[ Info: Downloading pre-compiled GR 0.66.2 Windows binary

How did you install Julia?

Aldo does C:\Users\allll.julia\artifacts\c3712e14d6f387fa0a6d1509acbdd4b8976e87d1\bin\Qt5Concurrent.dll exist?

One quick check you can try is to rename C:\Users\allll.julia to something else, then reinstall plots to see if that works.

1 Like

Thanks a lot! I will try it!

Use a triple backtick fence to make your code legible.

1 Like

Thanks a lot !!!
Thanks!!!

I did it!
Thanks for your help!
Have a good day!