Failure to Precompile Plots

Somehow my Plots installation is broken and I can’t figure out what’s going on. Plots compiles fine in my base environment, but if I switch to my project environment, it fails to precompile with the stack trace

using Plots

[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
ERROR: LoadError: InitError: could not load library “/Users/alexander.nenninger/.julia/artifacts/bf37190b92ac2fc3dd5e7073ff7ec7bbfd10343f/lib/libavdevice.58.13.100.dylib”
dlopen(/Users/alexander.nenninger/.julia/artifacts/bf37190b92ac2fc3dd5e7073ff7ec7bbfd10343f/lib/libavdevice.58.13.100.dylib, 0x0001): Library not loaded: @rpath/libssl.1.1.dylib
Referenced from: /Users/alexander.nenninger/.julia/artifacts/bf37190b92ac2fc3dd5e7073ff7ec7bbfd10343f/lib/libavdevice.58.13.100.dylib
Reason: tried: ‘/Users/alexander.nenninger/.julia/artifacts/bf37190b92ac2fc3dd5e7073ff7ec7bbfd10343f/lib/./libssl.1.1.dylib’ (no such file), ‘/Users/alexander.nenninger/.julia/artifacts/bf37190b92ac2fc3dd5e7073ff7ec7bbfd10343f/lib/./libssl.1.1.dylib’ (no such file), ‘/Users/alexander.nenninger/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/lib/julia/libssl.1.1.dylib’ (no such file), ‘/Users/alexander.nenninger/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/lib/julia/…/libssl.1.1.dylib’ (no such file), ‘/Users/alexander.nenninger/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/lib/libssl.1.1.dylib’ (no such file)
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/pG9bm/src/products/library_generators.jl:63 [inlined]
[4] init()
@ FFMPEG_jll ~/.julia/packages/FFMPEG_jll/OCtN5/src/wrappers/aarch64-apple-darwin.jl:39
[5] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
@ Base ./loading.jl:1115
[6] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
@ Base ./loading.jl:1061
[7] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
@ Base ./loading.jl:1506
[8] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1783
[9] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1660
[10] macro expansion
@ ./loading.jl:1648 [inlined]
[11] macro expansion
@ ./lock.jl:267 [inlined]
[12] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1611
[13] include
@ ./Base.jl:457 [inlined]
[14] 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:2049
[15] top-level scope
@ stdin:3
during initialization of module FFMPEG_jll
in expression starting at /Users/alexander.nenninger/.julia/packages/FFMPEG/OUpap/src/FFMPEG.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile FFMPEG [c87230d0-a227-11e9-1b43-d7ebe4e7570a] to “/Users/alexander.nenninger/.julia/compiled/v1.9/FFMPEG/jl_CrOwxf”.
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
[9] include(mod::Module, _path::String)
@ Base ./Base.jl:457
[10] include(x::String)
@ Plots ~/.julia/packages/Plots/sxUvK/src/Plots.jl:1
[11] top-level scope
@ ~/.julia/packages/Plots/sxUvK/src/Plots.jl:168
[12] include
@ ./Base.jl:457 [inlined]
[13] 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
[14] top-level scope
@ stdin:3
in expression starting at /Users/alexander.nenninger/.julia/packages/Plots/sxUvK/src/animation.jl:1
in expression starting at /Users/alexander.nenninger/.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/alexander.nenninger/.julia/compiled/v1.9/Plots/jl_hwrhi6”.
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

I did perform the trouble shooting steps suggested here, but the situation is unchanged.

For reference, this is my project.toml:

name = "Redacted"
uuid = "98517a01-9b76-40a2-a15c-11e76e650aca"
authors = ["redacted"]
version = "1.0.0-DEV"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
LowRankApprox = "898213cb-b102-5a47-900c-97e73b919f73"
Maxvol = "4cc553b9-be87-484b-81d9-b5ae2a4e3958"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Tullio = "bc48ee85-29a4-5162-ae0b-a64e1601d4bc"

[compat]
julia = "1.9, 1.8"

[extras]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
examples = ["BenchmarkTools", "JET", "DataFrames", "Plots", "Distributions"]
test = ["Test"]

Julia Version 1.9.4
Commit 8e5136fa297 (2023-11-14 08:46 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 8 × Apple M1
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
Threads: 1 on 4 virtual cores

This looks very similar to this issue

that unfortunately doesn’t have a resolution yet.

What’s the output of

]st -m FFMPEG_jll OpenSSL_jll

in your environment? I can already predict for FFMPEG_jll you’re using version 4.4.2+2 because bf37190b92ac2fc3dd5e7073ff7ec7bbfd10343f corresponds to https://github.com/JuliaBinaryWrappers/FFMPEG_jll.jl/blob/998c0edb99c7f184a90fccd38c83dd6782a707db/Artifacts.toml#L3 and that version required OpenSSL 1.1.x (as suggested by the error message). @jd-foster may be right that this is due to stacking conflicting environments. Updating FFMPEG_jll to version 4.4.4 should fix your issue, if possible at all.

2 Likes

Thanks. Here are the infos:

Project environment

]
activate .
st -m FFMPEG_jll OpenSSL_jll

Project REDACTED v1.0.0-DEV
Status ~/.julia/dev/*REDACTED*/Manifest.toml
[458c3c95] OpenSSL_jll v3.0.12+0

and

Base Environment

activate 
st -m FFMPEG_jll OpenSSL_jll

Status ~/.julia/environments/v1.9/Manifest.toml
⌃ [b22a6f82] FFMPEG_jll v4.4.2+2
⌅ [458c3c95] OpenSSL_jll v1.1.23+0

Edit: Weirdly enough, FFMPEG_jll is marked with a little green arrow, but ] up does not upgrade it to the latest version.

]add FFMPEG_jll@4.4.4

to see what’s holding it back.

Just in case, what is the output of versioninfo() in the Julia REPL. I’m looking for any references to LD_PRELOAD or LD_LIBRARY_PATH in the environment.

The problem is that the two stacked environments try load two different versions of OpenSSL_jll, but in practice only a single version of the library can be loaded. Other libraries trying to load the version which didn’t get loaded will fail to load themselves. This is precisely the issue mentioned above by James.

1 Like

Here

Why are there two different versions of this file, isn’t the package stored in one place? Does the import statement in a different environment somehow retrieve a different copy of this file?

The same package is resolved to use two different versions in the two stacked environments, but in practice it’s loaded only once (presumably the outer one).

@AlexanderNenninger you haven’t answered to this question.

Hi,

I have a similar problem: my Plots installation does not precompile. The error I get is this:

ERROR: LoadError: InitError: could not load library "C:\Users\viv\.julia\artifacts\3ac49f33c861f2eb1afea813bec920729529c0e0\bin\avcodec-58.dll"

I have only one package in this environment: Pluto.jl.

I have checked and:

Status `C:\Users\viv\macroI\Manifest.toml`
  [b22a6f82] FFMPEG_jll v4.4.4+1
  [458c3c95] OpenSSL_jll v3.0.12+0

My system info is as follows:

Commit bed2cd540a (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 4 × Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, haswell)
  Threads: 1 on 4 virtual cores

I do not know if this information is relevant or not, but at home I also have a Windows 10 machine, the same Julia version, and the same environment. I do not get any FFMPEG_jll installed, and … Plots works very well.

Thanks

Sorry, for being slow to answer. I was able to add FFMPEG_jll@4.4.4 in by base environment, there was a lot of recompiling, but no errors.

Plots seems to be fixed now, although I believe not due to me adding it. It started to work after I ran update on the base environment and FFMPEG_jll was upgraded to 4.4.2.