# Error with Pkg.add("Libdl")

**URL:** <https://discourse.julialang.org/t/error-with-pkg-add-libdl/29508>\
**Category:** General Usage\
**Tags:** package\
**Created:** [October 5, 2019, 12:31am UTC](https://discourse.julialang.org/t/error-with-pkg-add-libdl/29508 "2019-10-05T00:31:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tommaso16](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@tommaso16](https://discourse.julialang.org/u/tommaso16)\
**Post date:** [October 5, 2019, 12:31am UTC](https://discourse.julialang.org/t/error-with-pkg-add-libdl/29508/1 "2019-10-05T00:31:00Z")

</div>

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

```julia
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

```julia
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

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [October 5, 2019, 2:51am UTC](https://discourse.julialang.org/t/error-with-pkg-add-libdl/29508/2 "2019-10-05T02:51:50Z")

</div>

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](https://github.com/XiaojingGeorgeZhang/H-OBCA#how-to-run-the-parking-code) and `include`ing `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).

---

<div class="post-metadata">

**Author:** ![tommaso16](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@tommaso16](https://discourse.julialang.org/u/tommaso16)\
**Post date:** [October 7, 2019, 4:33pm UTC](https://discourse.julialang.org/t/error-with-pkg-add-libdl/29508/3 "2019-10-07T16:33:54Z")

</div>

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?
