# Julia fails to precompile plots

**URL:** <https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411>\
**Category:** General Usage\
**Created:** [October 7, 2022, 3:56pm UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411 "2022-10-07T15:56:16Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [October 7, 2022, 8:04pm UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411/21 "2022-10-07T20:04:53Z")

</div>

That didn’t help.

```julia
pkg> add GR_jll
julia> import GR_jll

```

should show use the underlying issue.

---

<div class="post-metadata">

**Author:** ![Matteo](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@Matteo](https://discourse.julialang.org/u/Matteo)\
**Post date:** [October 7, 2022, 8:05pm UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411/22 "2022-10-07T20:05:25Z")

</div>

> [@awasserman](#):
>
> `JULIA_DEPOT_PATH="$HOME/tmp/.julia" julia`

this gives me syntax error. Anyways I just downloaded the Mac version of Julia from the download web page. Maybe I choose the wrong one for my computer? or maybe, since I uninstall and installed it again few times, could it be that I didn’t delete in the correct way the previous versions that I had and now it’s overlapped in some ways?

---

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [October 7, 2022, 8:12pm UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411/23 "2022-10-07T20:12:42Z")

</div>

> or maybe, since I uninstall and installed it again few times, could it be that I didn’t delete in the correct way the previous versions that I had and now it’s overlapped in some ways?

You could also try to delete `~/.julia/artifacts` and try again.  
`GR_jll` is an artifact and it might not have been downloaded / installed properly.  
After deletion, running `pkg> instantiate` should download artifacts again.

---

<div class="post-metadata">

**Author:** ![awasserman](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@awasserman](https://discourse.julialang.org/u/awasserman)\
**Post date:** [October 7, 2022, 8:38pm UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411/24 "2022-10-07T20:38:09Z")

</div>

This command should be run within a terminal shell, not within the Julia REPL. This should start up your Julia session with a new, untouched directory that it can start downloading packages into.

```bash
JULIA_DEPOT_PATH="$HOME/tmp/.julia" julia

```

---

<div class="post-metadata">

**Author:** ![Matteo](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@Matteo](https://discourse.julialang.org/u/Matteo)\
**Post date:** [October 8, 2022, 6:01pm UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411/25 "2022-10-08T18:01:33Z")

</div>

Sorry for the late reply but as a new member I had a limit of replies I could send in the first day. Anyways in the meantime I also tried to uninstall everything (Julia and atom) again and use VS code instead. But the same error occurs…  
By the way, regarding this:

> [@t-bltg](#):
>
> That didn’t help.
> 
> ```julia
> pkg> add GR_jll
> julia> import GR_jll
> 
> ```
> 
> should show use the underlying issue.

I get as output the following:

```julia
(@v1.8) pkg> add GR_jll

   Resolving package versions...
    Updating `~/.julia/environments/v1.8/Project.toml`
  [d2c73de3] + GR_jll v0.69.1+0
  No Changes to `~/.julia/environments/v1.8/Manifest.toml`

julia> import GR_jll
[Info: Precompiling GR_jll [d2c73de3-f751-5644-a686-071e5b155ba9]
ERROR: LoadError: InitError: could not load library "/Users/matteomassaro/.julia/artifacts/a0db4e704fd0da4298744f012883535d351fa170/lib/QtConcurrent.framework/Versions/5/QtConcurrent"
dlopen(/Users/matteomassaro/.julia/artifacts/a0db4e704fd0da4298744f012883535d351fa170/lib/QtConcurrent.framework/Versions/5/QtConcurrent.dylib, 1): image not 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
    @ ~/.julia/packages/JLLWrappers/QpMQW/src/products/library_generators.jl:54 [inlined]
  [4] __init__ ()
    @ Qt5Base_jll ~/.julia/packages/Qt5Base_jll/lpIK6/src/wrappers/x86_64-apple-darwin.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
    @ ~/.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 /Users/matteomassaro/.julia/packages/GR_jll/48Bah/src/wrappers/x86_64-apple-darwin.jl:13
in expression starting at /Users/matteomassaro/.julia/packages/GR_jll/48Bah/src/GR_jll.jl:2
in expression starting at stdin:1
ERROR: Failed to precompile GR_jll [d2c73de3-f751-5644-a686-071e5b155ba9] to /Users/matteomassaro/.julia/compiled/v1.8/GR_jll/jl_CIxsPW.
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: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
  [9] eval
    @ ./boot.jl:368 [inlined]
 [10] eval
    @ ./Base.jl:65 [inlined]
 [11] repleval(m::Module, code::Expr, #unused#::String)
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.36.2/scripts/packages/VSCodeServer/src/repl.jl:222
 [12] (::VSCodeServer.var"#107#109"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.36.2/scripts/packages/VSCodeServer/src/repl.jl:186
 [13] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging ./logging.jl:511
 [14] with_logger
    @ ./logging.jl:623 [inlined]
 [15] (::VSCodeServer.var"#106#108"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.36.2/scripts/packages/VSCodeServer/src/repl.jl:187
 [16] #invokelatest#2
    @ ./essentials.jl:729 [inlined]
 [17] invokelatest(::Any)
    @ Base ./essentials.jl:726
 [18] macro expansion
    @ ~/.vscode/extensions/julialang.language-julia-1.36.2/scripts/packages/VSCodeServer/src/eval.jl:34 [inlined]
 [19] (::VSCodeServer.var"#61#62")()
    @ VSCodeServer ./task.jl:484

```

It looks like I have again the version v.069.1 of GR as opposed to v.069.4  
Maybe the uninstall/install process did this. But regardless I had the problem also with the newest version.

---

<div class="post-metadata">

**Author:** ![Matteo](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@Matteo](https://discourse.julialang.org/u/Matteo)\
**Post date:** [October 8, 2022, 6:02pm UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411/26 "2022-10-08T18:02:02Z")

</div>

this:

> [@t-bltg](#):
>
> You could also try to delete `~/.julia/artifacts` and try again.  
> `GR_jll` is an artifact and it might not have been downloaded / installed properly.  
> After deletion, running `pkg> instantiate` should download artifacts again.

didn’t work:(

and neither this:

> [@awasserman](#):
>
> `JULIA_DEPOT_PATH="$HOME/tmp/.julia" Julia`

---

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [October 8, 2022, 6:22pm UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411/27 "2022-10-08T18:22:47Z")

</div>

At least the stacktrace using `import GR_jll` is helpful.

Are there any files in `/Users/matteomassaro/.julia/artifacts/a0db4e704fd0da4298744f012883535d351fa170/lib/...` and under ?

This is odd, I cannot find `a0db4e704fd0da4298744f012883535d351fa170` in [GR\_jll.jl/Artifacts.toml at main · JuliaBinaryWrappers/GR\_jll.jl · GitHub](https://github.com/JuliaBinaryWrappers/GR_jll.jl/blob/main/Artifacts.toml) (it should correspond a `git-tree-sha1`).

@jheinen might be able to help since he’s on `macOS`.  
I’m a bit clueless now, sorry, since I’m working with `linux`.

EDIT: found it, the failing lib comes from `Qt5Base_jll` [Qt5Base\_jll.jl/Artifacts.toml at 5dd3940b351600d975a1e60973cea2a729919cf3 · JuliaBinaryWrappers/Qt5Base\_jll.jl · GitHub](https://github.com/JuliaBinaryWrappers/Qt5Base_jll.jl/blob/5dd3940b351600d975a1e60973cea2a729919cf3/Artifacts.toml).

What shows your `versioninfo()` ?

---

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [October 8, 2022, 6:27pm UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411/28 "2022-10-08T18:27:46Z")

</div>

It appears you are hitting [Failing to precompile Plots due to LoadError (Mac edition) - #7 by jeffzwe](https://discourse.julialang.org/t/failing-to-precompile-plots-due-to-loaderror-mac-edition/87911/7).

You can open a ticket in [Issues · JuliaPackaging/Yggdrasil · GitHub](https://github.com/JuliaPackaging/Yggdrasil/issues) about [Yggdrasil/build\_tarballs.jl at master · JuliaPackaging/Yggdrasil · GitHub](https://github.com/JuliaPackaging/Yggdrasil/blob/master/Q/Qt5Base/build_tarballs.jl) if you seek a solution to this.

And another related issue: [Qt-based JLLs fail to precompile on old macOS; affects GR and Plots.jl · Issue #2883 · JuliaPackaging/Yggdrasil · GitHub](https://github.com/JuliaPackaging/Yggdrasil/issues/2883).

---

<div class="post-metadata">

**Author:** ![Matteo](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@Matteo](https://discourse.julialang.org/u/Matteo)\
**Post date:** [October 8, 2022, 7:46pm UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411/29 "2022-10-08T19:46:49Z")

</div>

> [@t-bltg](#):
>
> Are there any files in `/Users/matteomassaro/.julia/artifacts/a0db4e704fd0da4298744f012883535d351fa170/lib/...` and under ?

Yes there are several files, but I don’t understand what they do.

Regarding:

> [@t-bltg](#):
>
> `versioninfo()`

I get:

```julia
julia> versioninfo() 
Julia Version 1.8.2
Commit 36034abf260 (2022-09-29 15:21 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin21.4.0)
  CPU: 4 × Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, broadwell)
  Threads: 1 on 4 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS =

```

I will then try to open a new ticket in [Issues · JuliaPackaging/Yggdrasil · GitHub](https://github.com/JuliaPackaging/Yggdrasil/issues) as you suggested. Are the other two links that you shared : [https://github.com/JuliaPackaging/Yggdrasil/blob/master/Q/Qt5Base/build\_tarballs.jl](https://github.com/JuliaPackaging/Yggdrasil/blob/master/Q/Qt5Base/build_tarballs.jl) and [Qt-based JLLs fail to precompile on old macOS; affects GR and Plots.jl · Issue #2883 · JuliaPackaging/Yggdrasil · GitHub](https://github.com/JuliaPackaging/Yggdrasil/issues/2883)  
reporting the same issue (or a connected one?)

EDIT: I just realized that my Mac is version 10.13. Could this be the reason of the issue? because in [Failing to precompile Plots due to LoadError (Mac edition)](https://discourse.julialang.org/t/failing-to-precompile-plots-due-to-loaderror-mac-edition/87911/7) they mention that you need at least version 10.14.

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [October 9, 2022, 12:32am UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411/30 "2022-10-09T00:32:32Z")

</div>

> EDIT: I just realized that my Mac is version 10.13. Could this be the reason of the issue? because in [Failing to precompile Plots due to LoadError (Mac edition)](https://discourse.julialang.org/t/failing-to-precompile-plots-due-to-loaderror-mac-edition/87911/7) they mention that you need at least version 10.14.

Yes. I could very well imagine that. Experience shows that the backwards compatibility with Qt is often limited to a maximum of 4 OS versions depending on the platform.

---

<div class="post-metadata">

**Author:** ![lewis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewis/32/5217_2.png) [@lewis](https://discourse.julialang.org/u/lewis)\
**Post date:** [November 2, 2022, 12:42am UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411/31 "2022-11-02T00:42:00Z")

</div>

This is still broken for me.

Here is my versioninfo():

```julia
Julia Version 1.8.2
Commit 36034abf260 (2022-09-29 15:21 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin21.4.0)
  CPU: 4 × Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 1 on 4 virtual cores

```

That version of MacOS is 12.6.1–\>so maybe mine is too new rather than too old.

Here is the status output for Plots and GR:

```julia
(@v1.8) pkg> status -m Plots GR
Status `~/.julia/environments/v1.8/Manifest.toml`
  [28b8d3ca] GR v0.69.5
  [91a5bcdd] Plots v1.35.7

```

I have manually add’ed GR. I can do using GR, but I don’t know any of its direct commands. using Plots still fails.

---

<div class="post-metadata">

**Author:** ![lewis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewis/32/5217_2.png) [@lewis](https://discourse.julialang.org/u/lewis)\
**Post date:** [November 2, 2022, 1:26am UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411/32 "2022-11-02T01:26:31Z")

</div>

I just reinstalled homebrew and had homebrew upgrade everything it had installed, so I have the latest version of QT and QT5:

```julia
Qt 5.15.6 (x86_64-little_endian-lp64 shared (dynamic) release build; by Clang 14.0.0 (clang-1400.0.29.102) (Apple)) on "cocoa"

```

This really didn’t make any difference. The problem is in GR itself.

---

<div class="post-metadata">

**Author:** ![lewis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewis/32/5217_2.png) [@lewis](https://discourse.julialang.org/u/lewis)\
**Post date:** [November 2, 2022, 2:03am UTC](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411/33 "2022-11-02T02:03:34Z")

</div>

Solved for me (maybe not for others…).

I ran `] status --outdated -m`  
and found that Blink was causing several packages to be downgraded. I rm’ed Blink and then both GR and Plots and any package requiring Plots (my own private package) were re-compiled.

Now both GR and Plots work.

[Previous page](https://discourse.julialang.org/t/julia-fails-to-precompile-plots/88411.md?page=1)
