# Plots.jl failing to precompile on Windows11

**URL:** <https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694>\
**Category:** New to Julia\
**Created:** [August 28, 2024, 6:29am UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694 "2024-08-28T06:29:21Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![GregVernon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregvernon/32/5611_2.png) [@GregVernon](https://discourse.julialang.org/u/GregVernon)\
**Post date:** [August 28, 2024, 6:29am UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694/1 "2024-08-28T06:29:21Z")

</div>

I’ve seen a [few](https://discourse.julialang.org/t/plots-and-gr-jll-is-not-working-and-fails-to-precompile/89657) [other](https://discourse.julialang.org/t/failed-to-precompile-plots-jl/89802) [posts](https://discourse.julialang.org/t/plots-not-working-on-windows/88322) [related](https://discourse.julialang.org/t/problem-installing-plots-jl-a-ffmpeg-issue/28766) to build issues with Plots.jl (and FFMPEG.jl), but it’s not clear to me what is / if there is a solution – and the final comment in the last of those examples recommends the previous poster create a new thread.

OS: Windows 11 Version 23H2 ( build `22631.4037`)  
Julia Version: `1.10.4 (2024-06-04)`

```julia
> ] activate my_package
(my_package) pkg> add Plots # I did this, got the error, then tried the next line
(my_package) pkg> build Plots
    Building FFMPEG → `C:\Users\Owner\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\9143266ba77d3313a4cf61d8333a1970e8c5d8b6\build.log`
ERROR: Error building `FFMPEG`: 
ERROR: LoadError: Unable to open libLLVM!
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] (::BinaryProvider.var"#open_libllvm#124")()
    @ BinaryProvider C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:652
  [3] detect_cxx11_string_abi()
    @ BinaryProvider C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:655
  [4] detect_compiler_abi()
    @ BinaryProvider C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:668
  [5] top-level scope
    @ C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:685
  [6] include(mod::Module, _path::String)
    @ Base .\Base.jl:495
  [7] include(x::String)
    @ BinaryProvider C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\BinaryProvider.jl:1
  [8] top-level scope
    @ C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\BinaryProvider.jl:12
  [9] include
    @ .\Base.jl:495 [inlined]
 [10] 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::String)
    @ Base .\loading.jl:2222
 [11] top-level scope
    @ stdin:3
in expression starting at C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:685
in expression starting at C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\BinaryProvider.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile BinaryProvider [b99e7846-7c00-51b0-8f62-c81ae34c0232] to "C:\\Users\\Owner\\.julia\\compiled\\v1.10\\BinaryProvider\\jl_C380.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:2468
  [3] compilecache
    @ .\loading.jl:2340 [inlined]
  [4] (::Base.var"#968#969"{Base.PkgId})()
    @ Base .\loading.jl:1974
  [5] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile C:\Users\Owner\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\FileWatching\src\pidfile.jl:93
  [6] #mkpidlock#6
    @ C:\Users\Owner\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\FileWatching\src\pidfile.jl:88 [inlined]
  [7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile C:\Users\Owner\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\FileWatching\src\pidfile.jl:111
  [8] #invokelatest#2
    @ .\essentials.jl:894 [inlined]
  [9] invokelatest
    @ .\essentials.jl:889 [inlined]
 [10] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base .\loading.jl:2983
 [11] maybe_cachefile_lock
    @ .\loading.jl:2980 [inlined]
 [12] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1970
 [13] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1812
 [14] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [15] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [16] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1803
 [17] macro expansion
    @ .\loading.jl:1790 [inlined]
 [18] macro expansion
    @ .\lock.jl:267 [inlined]
 [19] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1753
 [20] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [21] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [22] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1746
 [23] include(fname::String)
    @ Base.MainInclude .\client.jl:489
 [24] top-level scope
    @ none:5
in expression starting at C:\Users\Owner\.julia\packages\FFMPEG\guN1x\deps\build.jl:1

```

Just checking the `Unable to open libLLVM` message:

```julia
julia> @show Base.libllvm_path()
Base.libllvm_path() = Symbol("C:\\Users\\Owner\\.julia\\juliaup\\julia-1.10.4+0.x64.w64.mingw32\\bin\\libLLVM-15jl.dll")
Symbol("C:\\Users\\Owner\\.julia\\juliaup\\julia-1.10.4+0.x64.w64.mingw32\\bin\\libLLVM-15jl.dll")

```

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [August 28, 2024, 7:39am UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694/2 "2024-08-28T07:39:50Z")

</div>

You’re installing an extremely old version of FFMPEG.jl

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [August 28, 2024, 9:10am UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694/3 "2024-08-28T09:10:30Z")

</div>

Did you try:

```julia
mkdir test
cd test
julia --project="."

```

and then in Julia

```julia
using Pkg
pkg"add Plots"
pkg"add FFMPEG"

```

?

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [August 28, 2024, 12:06pm UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694/4 "2024-08-28T12:06:15Z")

</div>

> [@giordano](#):
>
> You’re installing an extremely old version of [FFMPEG.jl](https://juliahub.com/ui/Packages/General/FFMPEG)

How are you seeing that from the error message? I’m not saying you’re wrong, I just looked, and not sure where to find it, nor is it obvious what the problem or solution is.

I often install packages, and get downgrades. I think I know the cause, how to avoid, but for me and other users, it would be great if Julia only gets the latest versions, or explains why it doesn’t and how to fix.

[I suppose you’re right, though more likely only FFMPEG\_jll dependency might be too old, and only for Windows [11]?]

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [August 28, 2024, 12:43pm UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694/5 "2024-08-28T12:43:41Z")

</div>

Please read: [Working with Julia projects | Julia programming notes](https://ufechner7.github.io/2022/08/16/julia-projects.html)

You get old stuff installed if you are not using projects, install everything in the global environment, and forgot to remove some old package you tried out years ago. That will block updating to newer versions.

---

<div class="post-metadata">

**Author:** ![GregVernon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregvernon/32/5611_2.png) [@GregVernon](https://discourse.julialang.org/u/GregVernon)\
**Post date:** [August 28, 2024, 1:51pm UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694/6 "2024-08-28T13:51:46Z")

</div>

I did make a project, if that’s what you’re asking, that’s what I’m referring too with my `activate my_package` in my post.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [August 28, 2024, 1:52pm UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694/7 "2024-08-28T13:52:24Z")

</div>

> [@Palli](#):
>
> How are you seeing that from the error message?

From the fact it’s installing BinaryProvider, which is a very old package, and the fact this issue has been around for a while: [Don't factor JLLs into the resolver decision when multiple update options are possible · Issue #3898 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/3898)

> [@Palli](#):
>
> I suppose you’re righ

Thanks.

> [@Palli](#):
>
> though more likely only FFMPEG\_jll dependency might be too old,

If it’s installing BinaryProvider then it’s not using FFMPEG\_jll.

> [@Palli](#):
>
> and only for Windows

Package resolution isn’t system-dependent.

---

<div class="post-metadata">

**Author:** ![GregVernon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregvernon/32/5611_2.png) [@GregVernon](https://discourse.julialang.org/u/GregVernon)\
**Post date:** [August 28, 2024, 2:08pm UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694/8 "2024-08-28T14:08:31Z")

</div>

> [@ufechner7](#):
>
> You get old stuff installed if you are not using projects, install everything in the global environment, and forgot to remove some old package you tried out years ago. That will block updating to newer versions.

Ok, so maybe there’s something there… let me go into more detail about my situation:

On this computer I had installed Julia 1.8.3 in 2022 using the relevant `Official Binaries for Manual Download` installer from [Julia-Lang](https://julialang.org/). I don’t recall what I was using it for, but almost certainly installed Plots.jl and other packages in the global environment. Then last night I installed `juliaup` via `winget` and added the `release` and `lts` channels (kept `default` pointed to `release`):

```julia
PS > juliaup status
 Default Channel Version Update 
----------------------------------------------------
          lts 1.6.7+0.x64.w64.mingw32
       * release 1.10.4+0.x64.w64.mingw32

```

I then launched Julia (`release`), created my package, and attempted to add Plots.jl as shown in my original post.

Do I need to uninstall the non-`juliaup` install of Julia that I installed two years ago? Do I need to remove the `lts` version from `juliaup`?

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [August 28, 2024, 2:12pm UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694/9 "2024-08-28T14:12:17Z")

</div>

Sometimes I just delete the `.julia` folder in my home directory to have a fresh start. But don’t do that if you have stored any code you wrote yourself in there, like `startup.jl`.

No reason to remove the lts version. You can have any number of Julia versions installed in parallel, the packages are kept separate per major Julia version.

It might also help if you share the output of:

```julia
using Pkg
Pkg.status()

```

---

<div class="post-metadata">

**Author:** ![GregVernon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregvernon/32/5611_2.png) [@GregVernon](https://discourse.julialang.org/u/GregVernon)\
**Post date:** [August 28, 2024, 2:20pm UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694/10 "2024-08-28T14:20:07Z")

</div>

> [@ufechner7](#):
>
> It might also help if you share the output of:
> 
> ```julia
> using Pkg
> Pkg.status()
> 
> ```

```julia
Status `C:\Path\To\My\Project\Project.toml`
  [13f3f980] CairoMakie v0.12.9
  [b964fa9f] LaTeXStrings v1.3.1
  [23fbe1c1] Latexify v0.16.5
⌃ [91a5bcdd] Plots v1.40.1
  [d1185830] SymbolicUtils v3.5.0
  [0c5d862f] Symbolics v6.3.0
Info Packages marked with ⌃ have new versions available and may be upgradable.

```

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [August 28, 2024, 2:35pm UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694/11 "2024-08-28T14:35:46Z")

</div>

Did you try:

```julia
using Pkg
Pkg.up()

```

---

<div class="post-metadata">

**Author:** ![GregVernon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregvernon/32/5611_2.png) [@GregVernon](https://discourse.julialang.org/u/GregVernon)\
**Post date:** [August 28, 2024, 3:06pm UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694/12 "2024-08-28T15:06:45Z")

</div>

I hadn’t, but that does appear to have fixed it – though I won’t be able to fully verify until after work. I’ll update this post with the full solution (assuming it works) then for benefit of future Google-ers.
