Error with Pkg.add("Libdl")

Hello,
I am trying to run the command include(“setup.jl”) (referring to this code https://github.com/XiaojingGeorgeZhang/H-OBCA) but I get the error

INFO: Precompiling module PyPlot.
WARNING: could not import Base.pushfirst! into PyCall
WARNING: could not import Base.popfirst! into PyCall
WARNING: could not import Base.firstindex into PyCall
WARNING: could not import Base.lastindex into PyCall
WARNING: could not import Base.getproperty into PyCall
WARNING: could not import Base.setproperty! into PyCall
WARNING: could not import Base.propertynames into PyCall
ERROR: LoadError: LoadError: ArgumentError: Module Libdl not found in current path.
Run `Pkg.add("Libdl")` to install the Libdl package.
Stacktrace:
 [1] _require(::Symbol) at ./loading.jl:435
 [2] require(::Symbol) at ./loading.jl:405
 [3] include_from_node1(::String) at ./loading.jl:576
 [4] include(::String) at ./sysimg.jl:14
 [5] include_from_node1(::String) at ./loading.jl:576
 [6] include(::String) at ./sysimg.jl:14
 [7] anonymous at ./<missing>:2
while loading /home/tommaso/.julia/v0.6/PyCall/src/../deps/depsutils.jl, in expression starting on line 3
while loading /home/tommaso/.julia/v0.6/PyCall/src/PyCall.jl, in expression starting on line 33
ERROR: LoadError: Failed to precompile PyCall to /home/tommaso/.julia/lib/v0.6/PyCall.ji.
Stacktrace:
 [1] compilecache(::String) at ./loading.jl:710
 [2] _require(::Symbol) at ./loading.jl:463
 [3] require(::Symbol) at ./loading.jl:405
 [4] include_from_node1(::String) at ./loading.jl:576
 [5] include(::String) at ./sysimg.jl:14
 [6] anonymous at ./<missing>:2
while loading /home/tommaso/.julia/v0.6/PyPlot/src/PyPlot.jl, in expression starting on line 5
ERROR: LoadError: Failed to precompile PyPlot to /home/tommaso/.julia/lib/v0.6/PyPlot.ji.
Stacktrace:
 [1] compilecache(::String) at ./loading.jl:710
 [2] _require(::Symbol) at ./loading.jl:497
 [3] require(::Symbol) at ./loading.jl:405
 [4] include_from_node1(::String) at ./loading.jl:576
 [5] include(::String) at ./sysimg.jl:14
while loading /home/tommaso/H-OBCA-old/setup.jl, in expression starting on line 35

Trying to run Pkg.add("Libdl"), I get

ERROR: unknown package Libdl
macro expansion at ./pkg/entry.jl:53 [inlined]
(::Base.Pkg.Entry.##1#3{String,Base.Pkg.Types.VersionSet})() at ./task.jl:335
Stacktrace:
 [1] sync_end() at ./task.jl:287
 [2] macro expansion at ./task.jl:303 [inlined]
 [3] add(::String, ::Base.Pkg.Types.VersionSet) at ./pkg/entry.jl:51
 [4] (::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#add,Tuple{String}})() at ./pkg/dir.jl:36
 [5] cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#add,Tuple{String}}, ::String) at ./file.jl:70
 [6] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{String,N} where N) at ./pkg/dir.jl:36
 [7] add(::String) at ./pkg/pkg.jl:117

The version I am using is Version 0.6.4 (2018-07-09 19:09 UTC).
Anyone has an idea on how to solve this issue?
Thanks

You should really try to move away from Julia 0.6 as soon as possible, but I guess you’re constrained by this third-party code. Julia lacked the relative long-term stability that it has gained with the release of version 1. This is also a good reminder of how slow package manager operations were back then.

The immediate issue here is that Libdl is part of the standard library. So it doesn’t make sense to Pkg.add it (at least in in 0.6); it’s already available as part of base Julia.

Following the installation procedure at https://github.com/XiaojingGeorgeZhang/H-OBCA#how-to-run-the-parking-code and includeing setup.jl, I don’t get the same error (on OSX), and I get different warnings during precompilation of PyPlot. Instead, I get errors concerning missing Hiccup and DataFrames packages (after PyPlot has succesfully precompiled).

1 Like

Hi tkoolen,

Thank you for your answer, unfortunately I can not solve the Libdl error, and I can not find any working solutions online. Is there any workaround?