Error when calling 'using Cbc'

Hello, I think I need help. I’m trying to use Cbc. I’ve called the Pkg.add(“Cbc”) and it installs it as usual. But, when I called using Cbc this error message pops out:

julia> using Cbc
[ Info: Precompiling Cbc [9961bab8-2fa3-5c5a-9d89-47fab24efd76]
ERROR: LoadError: LoadError: InitError: could not load library "C:\Users\Rian Aristio\.julia\artifacts\c7f98e43f684af0864779feaae0e94a18f1b0d9c\bin\libopenblas.dll"
The specified module could not be found.
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl .\libdl.jl:114
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl .\libdl.jl:114
  [3] macro expansion
    @ C:\Users\Rian Aristio\.julia\packages\JLLWrappers\bkwIo\src\products\library_generators.jl:54 [inlined]    
  [4] __init__()
    @ OpenBLAS32_jll C:\Users\Rian Aristio\.julia\packages\OpenBLAS32_jll\SdrdP\src\wrappers\x86_64-w64-mingw32-libgfortran5.jl:9
  [5] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base .\loading.jl:696
  [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base .\loading.jl:782
  [7] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1020
  [8] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:936
  [9] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:923
 [10] include(mod::Module, _path::String)
    @ Base .\Base.jl:386
 [11] top-level scope
    @ C:\Users\Rian Aristio\.julia\packages\JLLWrappers\bkwIo\src\toplevel_generators.jl:170
 [12] include
    @ .\Base.jl:386 [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:1235
 [14] top-level scope
    @ none:1
 [15] eval
    @ .\boot.jl:360 [inlined]
 [16] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [17] top-level scope
    @ none:1
during initialization of module OpenBLAS32_jll
in expression starting at C:\Users\Rian Aristio\.julia\packages\CoinUtils_jll\2R4xl\src\wrappers\x86_64-w64-mingw32-cxx11.jl:4
in expression starting at C:\Users\Rian Aristio\.julia\packages\CoinUtils_jll\2R4xl\src\CoinUtils_jll.jl:2       
ERROR: LoadError: LoadError: Failed to precompile CoinUtils_jll [be027038-0da8-5614-b30d-e42594cb92df] to C:\Users\Rian Aristio\.julia\compiled\v1.6\CoinUtils_jll\jl_5014.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
    @ Base .\loading.jl:1385
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1329
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1043
  [5] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:936
  [6] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:923
  [7] include(mod::Module, _path::String)
    @ Base .\Base.jl:386
  [8] top-level scope
    @ C:\Users\Rian Aristio\.julia\packages\JLLWrappers\bkwIo\src\toplevel_generators.jl:170
  [9] include
    @ .\Base.jl:386 [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, UInt64}}, source::String)
    @ Base .\loading.jl:1235
 [11] top-level scope
    @ none:1
 [12] eval
    @ .\boot.jl:360 [inlined]
 [13] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [14] top-level scope
    @ none:1
in expression starting at C:\Users\Rian Aristio\.julia\packages\Clp_jll\ihKVc\src\wrappers\x86_64-w64-mingw32-libgfortran5-cxx11.jl:4
in expression starting at C:\Users\Rian Aristio\.julia\packages\Clp_jll\ihKVc\src\Clp_jll.jl:2
ERROR: LoadError: LoadError: Failed to precompile Clp_jll [06985876-5285-5a41-9fcb-8948a742cc53] to C:\Users\Rian Aristio\.julia\compiled\v1.6\Clp_jll\jl_492E.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
    @ Base .\loading.jl:1385
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1329
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1043
  [5] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:936
  [6] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:923
  [7] include(mod::Module, _path::String)
    @ Base .\Base.jl:386
  [8] top-level scope
    @ C:\Users\Rian Aristio\.julia\packages\JLLWrappers\bkwIo\src\toplevel_generators.jl:170
  [9] include
    @ .\Base.jl:386 [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, UInt64}}, source::String)
    @ Base .\loading.jl:1235
 [11] top-level scope
    @ none:1
 [12] eval
    @ .\boot.jl:360 [inlined]
 [13] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [14] top-level scope
    @ none:1
in expression starting at C:\Users\Rian Aristio\.julia\packages\Cgl_jll\PomnD\src\wrappers\x86_64-w64-mingw32-cxx11.jl:4
in expression starting at C:\Users\Rian Aristio\.julia\packages\Cgl_jll\PomnD\src\Cgl_jll.jl:2
ERROR: LoadError: LoadError: Failed to precompile Cgl_jll [3830e938-1dd0-5f3e-8b8e-b3ee43226782] to C:\Users\Rian Aristio\.julia\compiled\v1.6\Cgl_jll\jl_4381.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
    @ Base .\loading.jl:1385
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1329
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1043
  [5] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:936
  [6] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:923
  [7] include(mod::Module, _path::String)
    @ Base .\Base.jl:386
  [8] top-level scope
    @ C:\Users\Rian Aristio\.julia\packages\JLLWrappers\bkwIo\src\toplevel_generators.jl:170
  [9] include
    @ .\Base.jl:386 [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, UInt64}}, source::String)
    @ Base .\loading.jl:1235
 [11] top-level scope
    @ none:1
 [12] eval
    @ .\boot.jl:360 [inlined]
 [13] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [14] top-level scope
    @ none:1
in expression starting at C:\Users\Rian Aristio\.julia\packages\Cbc_jll\szzPm\src\wrappers\x86_64-w64-mingw32-libgfortran5-cxx11.jl:5
in expression starting at C:\Users\Rian Aristio\.julia\packages\Cbc_jll\szzPm\src\Cbc_jll.jl:2
ERROR: LoadError: Failed to precompile Cbc_jll [38041ee0-ae04-5750-a4d2-bb4d0d83d27d] to C:\Users\Rian Aristio\.julia\compiled\v1.6\Cbc_jll\jl_3D09.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
    @ Base .\loading.jl:1385
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1329
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1043
  [5] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:936
  [6] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:923
  [7] top-level scope
    @ C:\Users\Rian Aristio\.julia\packages\Cbc\vMMGG\src\Cbc.jl:15
  [8] include
    @ .\Base.jl:386 [inlined]
  [9] 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:1235
 [10] top-level scope
    @ none:1
 [11] eval
    @ .\boot.jl:360 [inlined]
 [12] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [13] top-level scope
    @ none:1
in expression starting at C:\Users\Rian Aristio\.julia\packages\Cbc\vMMGG\src\Cbc.jl:1
ERROR: Failed to precompile Cbc [9961bab8-2fa3-5c5a-9d89-47fab24efd76] to C:\Users\Rian Aristio\.julia\compiled\v1.6\Cbc\jl_3A9A.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
    @ Base .\loading.jl:1385
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1329
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1043
  [5] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:936
  [6] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:923
  [7] eval
    @ .\boot.jl:360 [inlined]
  [8] eval
    @ .\Base.jl:39 [inlined]
  [9] repleval(m::Module, code::Expr, #unused#::String)
    @ VSCodeServer c:\Users\Rian Aristio\.vscode\extensions\julialang.language-julia-1.3.32\scripts\packages\VSCodeServer\src\repl.jl:157
 [10] (::VSCodeServer.var"#69#71"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer c:\Users\Rian Aristio\.vscode\extensions\julialang.language-julia-1.3.32\scripts\packages\VSCodeServer\src\repl.jl:123
 [11] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging .\logging.jl:491
 [12] with_logger
    @ .\logging.jl:603 [inlined]
 [13] (::VSCodeServer.var"#68#70"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer c:\Users\Rian Aristio\.vscode\extensions\julialang.language-julia-1.3.32\scripts\packages\VSCodeServer\src\repl.jl:124
 [14] #invokelatest#2
    @ .\essentials.jl:708 [inlined]
 [15] invokelatest(::Any)
    @ Base .\essentials.jl:706
 [16] macro expansion
    @ c:\Users\Rian Aristio\.vscode\extensions\julialang.language-julia-1.3.32\scripts\packages\VSCodeServer\src\eval.jl:34 [inlined]
 [17] (::VSCodeServer.var"#53#54")()
    @ VSCodeServer .\task.jl:411

I am using Julia 1.6 on VS Code. I don’t understand what is happening and I need help troubleshooting it. Thanks in advance!

1 Like

I haven’t see one of these errors in a long time!

What happens if you try

Pkg.build("Cbc")

then restart Julia (or vs-code).

If that doesn’t work, what is import Pkg; Pkg.status() and versioninfo()?

Thanks for the reply! I’ve done what you suggested and after calling the Pkg.build("Cbc"), it still gives the same error. Below is the result of import Pkg;Pkg.status() :

julia> import Pkg;Pkg.status()
      Status `C:\Users\Rian Aristio\.julia\environments\v1.6\Project.toml`
  [c52e3926] Atom v0.12.34
  [6e4b80f9] BenchmarkTools v1.1.4
  [336ed68f] CSV v0.8.5
  [9961bab8] Cbc v0.8.1
  [a93c6f00] DataFrames v1.2.2
  [864edb3b] DataStructures v0.18.10
  [85a47980] Dictionaries v0.3.11
  [b4f34e82] Distances v0.10.3
  [60bf3e95] GLPK v0.14.12
  [2e9cd046] Gurobi v0.9.14
  [4076af6c] JuMP v0.21.9
  [e5e0dc1b] Juno v0.8.4
  [093fc24a] LightGraphs v1.3.5
  [3b828b28] Nexus v0.1.0 `..\..\dev\Nexus`
  [295af30f] Revise v3.1.19
  [efcf1570] Setfield v0.7.1
  [2913bbd2] StatsBase v0.33.9
  [44cfe95a] Pkg
  [10745b16] Statistics

and the result for versioninfo():

julia> versioninfo()
Julia Version 1.6.2
Commit 1b93d53fc4 (2021-07-14 15:36 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-6560U CPU @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS =

Are you using Atom or VSCode? Does it work outside VS-Code, e.g., just in a terminal? What happens if you ] rm Atom Juno then try again? I’ve heard some people had problems with Atom mangling the path.

cc @giordano might have some ideas.

I am using VS Code right now, I used to work on Atom (JuliaPro) on Julia 1.5 and Cbc runs to no problem. Recently I moved to VS Code and installed Julia 1.6 and the first time I was adding Cbc this happened.

I’ve tried to call using Cbc in the terminal, but it still won’t work. Removing Atom and Juno still gives no result :cry:.

Anyway, I’m curious why do I still have Juno and Atom in my registry after uninstalling Julia? I uninstalled julia by uninstalling JuliaPro I guess, is it an “unclean” way of uninstalling?

These issues are always…uhm…fun to debug. This is also weird because OpenBLAS32_jll only depends on a standard library, so it should easily find everything it needs.

You can try using DependencyWalker.jl, even though I haven’t given much love to this package lately.

After you get the error, in the same session, install DependencyWalker in a temporary environment not to clutter your main environment):

]activate --temp
add DependencyWalker

then do

using DependencyWalker
Library(raw"C:\Users\Rian Aristio\.julia\artifacts\c7f98e43f684af0864779feaae0e94a18f1b0d9c\bin\libopenblas.dll")

Missing libraries should be clearly indicated

1 Like

Thank you @giordano for the response! I’ve used the dependency walker and it indicates that libopenblas.dll is not found:

julia> using DependencyWalker
julia> Library(raw"C:\Users\Rian Aristio\.julia\artifacts\c7f98e43f684af0864779feaae0e94a18f1b0d9c\bin\libopenblas.dll")
✗ C:\Users\Rian Aristio\.julia\artifacts\c7f98e43f684af0864779feaae0e94a18f1b0d9c\bin\libopenblas.dll (NOT FOUND)

But, I don’t think have the proper knowledge for resolving this issue of libraries. Could you give me some pointers? Thanks in advance.

Wait, is the file itself missing? Do you have C:\Users\Rian Aristio\.julia\artifacts\c7f98e43f684af0864779feaae0e94a18f1b0d9c\bin\libopenblas.dll? Do you have the directory C:\Users\Rian Aristio\.julia\artifacts\c7f98e43f684af0864779feaae0e94a18f1b0d9c?

It turns out that the directory C:\Users\Rian Aristio\.julia\artifacts\c7f98e43f684af0864779feaae0e94a18f1b0d9c exists! But it’s empty

Delete the directory and restart Julia, it should be downloaded automatically

1 Like

It worked! thanks a lot @giordano

2 Likes