# Problem while precompiling \`Plots\` and \`StatsPlots\`

**URL:** <https://discourse.julialang.org/t/problem-while-precompiling-plots-and-statsplots/88413>\
**Category:** New to Julia\
**Tags:** package, precompilation\
**Created:** [October 7, 2022, 4:48pm UTC](https://discourse.julialang.org/t/problem-while-precompiling-plots-and-statsplots/88413 "2022-10-07T16:48:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Debartha\_Paul](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/debartha_paul/32/202192_2.png) [@Debartha\_Paul](https://discourse.julialang.org/u/Debartha_Paul)\
**Post date:** [October 7, 2022, 4:48pm UTC](https://discourse.julialang.org/t/problem-while-precompiling-plots-and-statsplots/88413/1 "2022-10-07T16:48:06Z")

</div>

I updated all the packages in my local system (using the `update` command in `Pkg` REPL) and since then onwards, I am facing a kind of precompilation issue while precompiling the `Plots` and `StatsPlots` packages. I decided to uninstall and reinstall them after rebooting my system but the problem persists.

```julia
(@v1.7) pkg> add Plots
Updating registry at 'C:\Users\user\.julia\registries\General.toml
Resolving package versions...
Updating -C:\Users\user\.julia\environments\v1.7\Project.toml
[91a5bcdd] + Plots v1.35.2
Updating -C:\Users\user\.julia\environments\v1.7\Manifest.toml
[28b8d3ca] + GR v0.69.4
[1019f520] + JLFzf v0.1.5
[23fbe1c1] + Latexify v0.15.17
[442fdcdd] + Measures v0.3.1
[b98c9c47] + Pipe v1.3.0
[ccf2f8ad] + PlotThemes v3.0.0
[91a5bcdd] + Plots v1.35.2
[01d81517] + RecipesPipeline v0.6.6
[41fe7b60] + Unzip v0.2.0
[d2c73de3] + GR_j11 v0.69.1+0
[ea2cea3b] + Qt5Base_j11 v5.15.3+1
[a2964d1f] + Wayland_jll v1.19.0+0
[23816f8a] + Wayland_protocols_jll v1.25.0+0
[cc61e674] + Xorg_libxkbfile_j11 v1.1.0+4
[12413925] + Xorg_xcb_util_image_jll v0.4.0+1
[2def613f] + Xorg_xcb_util_j11 v0.4.0+1
[975044d2] + Xorg_xcb_util_keysyms_j11 v0.4.0+1
[0d47668e] + Xorg_xcb_util_renderutil_jll v0.3.9+1
[c22f9abO] + Xorg_xcb_util_wm_j11 v0.4.1+1
[35661453] + Xorg_xkbcomp_j11 v1.4.2+4
[33bec58e] + Xorg_xkeyboard_config_j11 v2.27.0+4
[214eeab7] + fzf_j11 v0.29.0+0
[d8fb68d0] + xkbcommon_j11 v1.4.1+0
Precompiling project...
X Plots
0 dependencies successfully precompiled in 9 seconds (358 already precompiled)
1 dependency errored. To see a full report either run import Pkg; Pkg.precompile() or load the package 

```

Upon trying to precompile, I face this error:

```julia
(@v1.7) pkg> precompile
Precompiling project...
X Plots
0 dependencies successfully precompiled in 27 seconds (358 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\user\julia\compiled\v1.7\Plots\j1_8EF3Amp.
ERROR: LoadError: InitError: could not load library "C:\Users\user\julia\artifacts\e40afe22fcfc9fe1caea4af17a4016e7ef36cd66\bin\liWKS.d11"
The specified module could not be found.
Stacktrace:
    [1] dlopen(s::String, flags::UInt32; throw_error::Bool) @ Base.Libc.Libdl
    [2] dlopen(s::String, flags::UInt32) @ Base.Libc.Libdl .\libdl.'1:117
    [3] macro expansion @ C:\Users\user\.julia\packages\JLLWrappers\QpMQW\src\products\library generators.i1:54 [inlined]
    [4] init () @ GR_jll C:\Users\user\.julia\packages\GRj11\48Bah\src\wrappers\x86 64-w64-min w32-cxx11.'1:23
    [5] _include_from_serialized(path::String, depmods::VectorlAnyl) @ Base .\loadin .'1:768
    [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String) @ Base .\loadin ..1:854
    [7] _tryrequire_from_serialized(modkey::Base.PkgId, build_id::UInt64, modpath::String) @ Base .\loadin .'1:783
    [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String) @ Base .\loading.i1:843
    [9] _require(pkg::Base.PkgId) @ Base .\loading.i1:1097
    [10] require(uuidkey::Base.PkgId) @ Base .\loading.i1:1013
    [11] require(into::Module, mod::Symbol) @ Base .\loadin .'1:997
    [12] include(mod::Module, _path::String) @ Base .\Base.'1:418
    [13] include(x::String) @ Plots C:\Users\user\.julia\packages\Plots\CUQan\src\Plots..1:1
    [14] top-level scope @ C:\Users\user\.julia\packages\Plots\CUQan\src\Plots.'1:201
    [15] include @ .\Base.j1:418 [inlined]
    [16] 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{PairlBase.PkgId, UInt641}, source::Noth ing) @ Base .\loading.i1:1318
    [17] top-level scope @ none:1
    [18] eval @ .\boot.11:373 [inlined]
    [19] eval(x::Expr) @ Base.Mainlnclude .\client.'1:453
    [20] top-level scope @ none:1
during initialization of module GR_j11
in expression starting at C:\Users\user\.julia\packages\Plots\CUQan\src\backends\gr.j1:3
in expression starting at C:\Users\user\.julia\packages\Plots\CUQan\src\Plots.j1:1

```

It was working fine before the update. I would appreciate it if someone helped me.

P.S.: This same problem is also happening while precompiling the `StatsPlots` package.

I am using:

```julia
Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, tigerlake)

```

EDIT: I am providing the screenshots of the said error:

 ![Screenshot 2022-10-07 211650](https://global.discourse-cdn.com/julialang/original/3X/5/3/53ce9264c3cebf1ab50ed75f30df8b634b7d59a5.jpeg)

 ![Screenshot 2022-10-07 214243](https://global.discourse-cdn.com/julialang/original/3X/f/d/fda1e672196e813224b006a0d80a91912347d5f3.jpeg)

 ![Screenshot 2022-10-07 220633](https://global.discourse-cdn.com/julialang/original/3X/a/5/a56290eb8b4f7fc8a03fdc2595c0fc850decd04a.jpeg)

---

<div class="post-metadata">

**Author:** ![sjkelly](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sjkelly/32/9280_2.png) [@sjkelly](https://discourse.julialang.org/u/sjkelly)\
**Post date:** [October 7, 2022, 6:54pm UTC](https://discourse.julialang.org/t/problem-while-precompiling-plots-and-statsplots/88413/2 "2022-10-07T18:54:46Z")

</div>

Can you show the contents of `C:\Users\user\julia\artifacts\e40afe22fcfc9fe1caea4af17a4016e7ef36cd66\bin\`?

It is also strange that `dll` and `jll` are sometimes rendered as `d11` and `j11` in your post.

---

<div class="post-metadata">

**Author:** ![Debartha\_Paul](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/debartha_paul/32/202192_2.png) [@Debartha\_Paul](https://discourse.julialang.org/u/Debartha_Paul)\
**Post date:** [October 8, 2022, 10:58am UTC](https://discourse.julialang.org/t/problem-while-precompiling-plots-and-statsplots/88413/3 "2022-10-08T10:58:08Z")

</div>

@sjkelly I am incredibly sorry for forgetting to add the screenshots. Actually, I could not copy-paste the error outputs from the REPL so I took screenshots and used an image-to-text converter to print out the words. I have added the screenshots now. Those are actually `.dll` and were mistakenly rendered as `.j11`

As for your request on the contents of the said folder, I found that the folder `e40afe22fcfc9fe1caea4af17a4016e7ef36cd66` is **totally empty**. Inside the `artifacts` folder, there are many folders similar to this huge-named folder, and all of them have something inside it like `bin`, `logs` and `share`, except this one. I have never encountered such an issue before.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/3/33d94f63b91705f7c8c10cab5da3b3c35b6113cf.png)

---

<div class="post-metadata">

**Author:** ![Debartha\_Paul](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/debartha_paul/32/202192_2.png) [@Debartha\_Paul](https://discourse.julialang.org/u/Debartha_Paul)\
**Post date:** [October 9, 2022, 7:29am UTC](https://discourse.julialang.org/t/problem-while-precompiling-plots-and-statsplots/88413/4 "2022-10-09T07:29:08Z")

</div>

Solved by @t-bltg in [this thread](https://discourse.julialang.org/t/plots-not-working-on-windows/88322/11):

On your screenshots, your artifacts folder is empty, this explain the error loading the `dll` s.  
Delete it, and then run `pkg> instantiate` : it should download the artifacts and you should see `bin` and / or `lib` with `dll` s in it.  
Try `e40afe22fcfc9fe1caea4af17a4016e7ef36cd66` first, then `artifacts` if that still does not work.
