Skip to content

[BUG] ERROR: LoadError: InitError: could not load library "libavdevice.58.13.100.dylib" when precompiling Plots.jl on macOS #4390

@singularitti

Description

@singularitti

Details

I have the following error messages when precompiling Plots.jl:

julia> using Plots
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
ERROR: LoadError: InitError: could not load library "/Users/xxx/.julia/artifacts/edc52b246257a6a584e140abf9d9658504f99264/lib/libavdevice.58.13.100.dylib"
dlopen(/Users/xxx/.julia/artifacts/edc52b246257a6a584e140abf9d9658504f99264/lib/libavdevice.58.13.100.dylib, 0x0001): Library not loaded: '@rpath/libpcre.1.dylib'
  Referenced from: '/Users/xxx/.julia/artifacts/edc52b246257a6a584e140abf9d9658504f99264/lib/libavdevice.58.13.100.dylib'
  Reason: tried: '/Users/xxx/.julia/artifacts/edc52b246257a6a584e140abf9d9658504f99264/lib/./libpcre.1.dylib' (no such file), '/Users/xxx/.julia/artifacts/edc52b246257a6a584e140abf9d9658504f99264/lib/./libpcre.1.dylib' (no such file), '/Users/xxx/.julia/juliaup/julia-1.8.1+0.aarch64/lib/julia/libpcre.1.dylib' (no such file), '/Users/xxx/.julia/juliaup/julia-1.8.1+0.aarch64/bin/../lib/libpcre.1.dylib' (no such file), '/usr/local/lib/libpcre.1.dylib' (no such file), '/usr/lib/libpcre.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/QpMQW/src/products/library_generators.jl:54 [inlined]
  [4] __init__()
    @ FFMPEG_jll ~/.julia/packages/FFMPEG_jll/9kTcb/src/wrappers/aarch64-apple-darwin.jl:38
  [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
    @ ./Base.jl:419 [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, UInt64}}, source::String)
    @ Base ./loading.jl:1554
 [14] top-level scope
    @ stdin:1
during initialization of module FFMPEG_jll
in expression starting at /Users/xxx/.julia/packages/FFMPEG/OUpap/src/FFMPEG.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile FFMPEG [c87230d0-a227-11e9-1b43-d7ebe4e7570a] to /Users/xxx/.julia/compiled/v1.8/FFMPEG/jl_WnrelS.
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:1705
  [3] compilecache
    @ ./loading.jl:1649 [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] include(mod::Module, _path::String)
    @ Base ./Base.jl:419
 [10] include(x::String)
    @ Plots ~/.julia/packages/Plots/nbICw/src/Plots.jl:1
 [11] top-level scope
    @ ~/.julia/packages/Plots/nbICw/src/Plots.jl:181
 [12] include
    @ ./Base.jl:419 [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, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1554
 [14] top-level scope
    @ stdin:1
in expression starting at /Users/xxx/.julia/packages/Plots/nbICw/src/animation.jl:1
in expression starting at /Users/xxx/.julia/packages/Plots/nbICw/src/Plots.jl:1
in expression starting at stdin:1
ERROR: Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to /Users/xxx/.julia/compiled/v1.8/Plots/jl_fQYcYh.
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:1705
 [3] compilecache
   @ ./loading.jl:1649 [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

I am running the code on Macs with M1 Pro chips. I tested both on M1-optimized and Intel versions of Julia. They have the same error. I noticed that Plots.jl & GR.jl has just updated. Could it be the reason?

Backends

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pyplot
plotlyjs
pgfplotsx
unicodeplots
inspectdr
gaston

Versions

Plots.jl version: v1.34.3
Backend version (]st -m <backend(s)>): v0.69.1
Output of versioninfo():

julia> versioninfo()
Julia Version 1.8.1
Commit afb6c60d69a (2022-09-06 15:09 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.5.0)
  CPU: 10 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, apple-m1)
  Threads: 1 on 8 virtual cores

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions