# Plots, InitError GR\_jll not defined

**URL:** <https://discourse.julialang.org/t/plots-initerror-gr-jll-not-defined/107633>\
**Category:** New to Julia\
**Created:** [December 14, 2023, 9:25pm UTC](https://discourse.julialang.org/t/plots-initerror-gr-jll-not-defined/107633 "2023-12-14T21:25:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hilbertstraum](https://avatars.discourse-cdn.com/v4/letter/h/a88e4f/32.png) [@hilbertstraum](https://discourse.julialang.org/u/hilbertstraum)\
**Post date:** [December 14, 2023, 9:25pm UTC](https://discourse.julialang.org/t/plots-initerror-gr-jll-not-defined/107633/1 "2023-12-14T21:25:32Z")

</div>

Hi, im new to Julia and wanted to try out some plotting with the Plots-Package. Did run into similar problems as:

> [@Plots and GR\_jll is not working and fails to precompile](https://discourse.julialang.org/t/plots-and-gr-jll-is-not-working-and-fails-to-precompile/89657/5):
>
> Try the solution I found here: Basically, execute the following and then restart Julia: Base.compilecache(Base.identify\_package("GR"))

or:

> [@Plots, InitError: UndefVarError: GR\_jll not defined](https://discourse.julialang.org/t/plots-initerror-undefvarerror-gr-jll-not-defined/102448/5):
>
> Interesting. So if ENV[“GRDIR”] is set to a local build, import GR\_jll will throw an error? Is that still the case now that we are not automatically loading any shared libraries via GR\_jll due to using dont\_dlopen=true in the recipe? @jheinen, could you test if we still need that try - catch block in your environment? If GR\_jll still throws an error on import, I wonder it would make sense to develop a placeholder GR\_jll that is just empty? I still wonder if we can insert something under if …

but the solution did not work out for me. I got the

```julia
GR.plot(rand(10))

```

to work, but “using Plots” still yields this error:  
ERROR: LoadError: InitError: UndefVarError: `GR_jll` not defined  
Stacktrace:  
[1] **init** ()  
@ GR.GRPreferences C:\Users\thoma.julia\packages\GR\yBe3g\src\preferences.jl:64  
[2] register\_restored\_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)  
@ Base .\loading.jl:1115  
[3] \_include\_from\_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})  
@ Base .\loading.jl:1061  
[4] \_require\_search\_from\_serialized(pkg::Base.PkgId, sourcepath::String, build\_id::UInt128)  
@ Base .\loading.jl:1506  
[5] \_require(pkg::Base.PkgId, env::String)  
@ Base .\loading.jl:1783  
[6] \_require\_prelocked(uuidkey::Base.PkgId, env::String)  
@ Base .\loading.jl:1660  
[7] macro expansion  
@ .\loading.jl:1648 [inlined]  
[8] macro expansion  
@ .\lock.jl:267 [inlined]  
[9] require(into::Module, mod::Symbol)  
@ Base .\loading.jl:1611  
[10] top-level scope  
@ C:\Users\thoma.julia\packages\Plots\sxUvK\src\backends.jl:402  
[11] eval  
@ .\boot.jl:370 [inlined]  
[12] \_initialize\_backend(pkg::Plots.GRBackend)  
@ Plots C:\Users\thoma.julia\packages\Plots\sxUvK\src\backends.jl:401  
[13] backend(pkg::Plots.GRBackend)  
@ Plots C:\Users\thoma.julia\packages\Plots\sxUvK\src\backends.jl:266  
[14] backend(sym::Symbol)  
@ Plots C:\Users\thoma.julia\packages\Plots\sxUvK\src\backends.jl:276  
[15] load\_default\_backend()  
@ Plots C:\Users\thoma.julia\packages\Plots\sxUvK\src\backends.jl:207  
[16] backend()  
@ Plots C:\Users\thoma.julia\packages\Plots\sxUvK\src\backends.jl:254  
[17] top-level scope  
@ C:\Users\thoma.julia\packages\Plots\sxUvK\src\init.jl:83  
[18] include(mod::Module, \_path::String)  
@ Base .\Base.jl:457  
[19] include(x::String)  
@ Plots C:\Users\thoma.julia\packages\Plots\sxUvK\src\Plots.jl:1  
[20] top-level scope  
@ C:\Users\thoma.julia\packages\Plots\sxUvK\src\Plots.jl:176  
[21] include  
@ .\Base.jl:457 [inlined]  
[22] 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:2049  
[23] top-level scope  
@ stdin:3  
during initialization of module GRPreferences  
in expression starting at C:\Users\thoma.julia\packages\Plots\sxUvK\src\init.jl:83  
in expression starting at C:\Users\thoma.julia\packages\Plots\sxUvK\src\Plots.jl:1  
in expression starting at stdin:3  
ERROR: Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to “C:\Users\thoma\.julia\compiled\v1.9\Plots\jl\_3071.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:2294  
[3] compilecache  
@ .\loading.jl:2167 [inlined]  
[4] \_require(pkg::Base.PkgId, env::String)  
@ Base .\loading.jl:1805  
[5] \_require\_prelocked(uuidkey::Base.PkgId, env::String)  
@ Base .\loading.jl:1660  
[6] macro expansion  
@ .\loading.jl:1648 [inlined]  
[7] macro expansion  
@ .\lock.jl:267 [inlined]  
[8] require(into::Module, mod::Symbol)  
@ Base .\loading.jl:1611

Maybe someone has another idea what to do.

Thank u 🙂
