# Plots not precompiling on macos apple silicon

**URL:** <https://discourse.julialang.org/t/plots-not-precompiling-on-macos-apple-silicon/108472>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [January 7, 2024, 5:22pm UTC](https://discourse.julialang.org/t/plots-not-precompiling-on-macos-apple-silicon/108472 "2024-01-07T17:22:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peteole](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peteole/32/209790_2.png) [@peteole](https://discourse.julialang.org/u/peteole)\
**Post date:** [January 7, 2024, 5:22pm UTC](https://discourse.julialang.org/t/plots-not-precompiling-on-macos-apple-silicon/108472/1 "2024-01-07T17:22:06Z")

</div>

Hi, recently the plotting library broke down after an update of julia to 1.9.4 using homebrew on macos apple silicon. The precompilation fails:

```julia
using Plots
[Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
ERROR: LoadError: InitError: UndefVarError: `GR_jll` not defined
Stacktrace:
  [1] __init__ ()
    @ GR.GRPreferences ~/.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
    @ ~/.julia/packages/Plots/sxUvK/src/backends.jl:402
 [11] eval
    @ ./boot.jl:370 [inlined]
 [12] _initialize_backend(pkg::Plots.GRBackend)
    @ Plots ~/.julia/packages/Plots/sxUvK/src/backends.jl:401
 [13] backend(pkg::Plots.GRBackend)
    @ Plots ~/.julia/packages/Plots/sxUvK/src/backends.jl:266
 [14] backend(sym::Symbol)
    @ Plots ~/.julia/packages/Plots/sxUvK/src/backends.jl:276
 [15] load_default_backend()
    @ Plots ~/.julia/packages/Plots/sxUvK/src/backends.jl:207
 [16] backend()
    @ Plots ~/.julia/packages/Plots/sxUvK/src/backends.jl:254
 [17] top-level scope
    @ ~/.julia/packages/Plots/sxUvK/src/init.jl:83
 [18] include(mod::Module, _path::String)
    @ Base ./Base.jl:457
 [19] include(x::String)
    @ Plots ~/.julia/packages/Plots/sxUvK/src/Plots.jl:1
 [20] top-level scope
    @ ~/.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 /Users/ole/.julia/packages/Plots/sxUvK/src/init.jl:83
in expression starting at /Users/ole/.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 "/Users/ole/.julia/compiled/v1.9/Plots/jl_Q8YgWp".
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

```

Any idea?

---

<div class="post-metadata">

**Author:** ![peteole](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peteole/32/209790_2.png) [@peteole](https://discourse.julialang.org/u/peteole)\
**Post date:** [January 7, 2024, 5:27pm UTC](https://discourse.julialang.org/t/plots-not-precompiling-on-macos-apple-silicon/108472/2 "2024-01-07T17:27:45Z")

</div>

Update: reinstalling julia and removing `~/.julia` fixed the problem.

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [January 7, 2024, 5:31pm UTC](https://discourse.julialang.org/t/plots-not-precompiling-on-macos-apple-silicon/108472/3 "2024-01-07T17:31:24Z")

</div>

Hi. We’re sorry that plotting library broke for you. Note that Plots.jl is one of many plotting libraries available for Julia. Note that homebrew is not an [officially supported method of installing Julia](https://julialang.org/downloads/), and that you may need to seek help from homebrew.

1. Could you provide the output of `versioninfo()` and `using Pkg; Pkg.status()"?
2. Depending on whether you used the cask or not, your situation might be better resolved by the homebrew maintainers regarding their [formula](https://github.com/Homebrew/homebrew-core/blob/0f7b4ed2ee5a250c10d3c856bb959a8805bd060d/Formula/j/julia.rb).
3. You might want to try configuring GR.jl directly. In particular, try this sequence.

```julia
using GR # install, precompile might fail
using GR # this will load something anyways
GR.GRPreferences.diagnostics()

```

1. See the [GR.jl README](https://github.com/jheinen/GR.jl/blob/master/README.md) for further details on configuration.

Provide all output directly from console from the requested commands above. Thank you. Have a nice day!
