# LoadError while precompiling Plots.jl on Ubuntu 18.04

**URL:** <https://discourse.julialang.org/t/loaderror-while-precompiling-plots-jl-on-ubuntu-18-04/58784>\
**Category:** Package Management\
**Tags:** precompilation, plots, artifacts\
**Created:** [April 7, 2021, 6:44pm UTC](https://discourse.julialang.org/t/loaderror-while-precompiling-plots-jl-on-ubuntu-18-04/58784 "2021-04-07T18:44:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anemometer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/anemometer/32/23744_2.png) [@Anemometer](https://discourse.julialang.org/u/Anemometer)\
**Post date:** [April 7, 2021, 6:44pm UTC](https://discourse.julialang.org/t/loaderror-while-precompiling-plots-jl-on-ubuntu-18-04/58784/1 "2021-04-07T18:44:15Z")

</div>

Hello,

I have run into some trouble trying to install the `Plots.jl` package and I couldn’t find any hints on how to proceed besides nuking my `.julia` folder which I would like to avoid if at all possible.

Adding the `Plots.jl` package via `add Plots` proceeds as normal installing all dependencies, but as soon as the precompilation step is reached, julia throws multiple `LoadErrrors` (this happened both in 1.5.2 and in 1.6.0, but I will provide the output from 1.6.0).  
The first package to fail seems to be `Xorg_libxcb_jll` with the message

```julia
ERROR: The following 1 direct dependency failed to precompile:

Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]

ERROR: LoadError: LoadError: InitError: could not load library "/home/daniel/.julia/artifacts/054d833658de90eb397ffffe590e8fce242fe1e6/lib/libexslt.so"
/usr/lib/x86_64-linux-gnu/libxslt.so.1: version `LIBXML2_1.1.30' not found (required by /home/daniel/.julia/artifacts/054d833658de90eb397ffffe590e8fce242fe1e6/lib/libexslt.so)
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
    @ ~/.julia/packages/JLLWrappers/WnWcZ/src/products/library_generators.jl:63 [inlined]
  [4] __init__ ()
    @ XSLT_jll ~/.julia/packages/XSLT_jll/siCq8/src/wrappers/x86_64-linux-gnu.jl:11
  [5] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base ./loading.jl:674
  [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base ./loading.jl:760
  [7] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:998
  [8] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [9] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
 [10] include(mod::Module, _path::String)
    @ Base ./Base.jl:386
 [11] top-level scope
    @ ~/.julia/packages/JLLWrappers/WnWcZ/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:1213
 [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 XSLT_jll
in expression starting at /home/daniel/.julia/packages/Xorg_libxcb_jll/nMYKH/src/wrappers/x86_64-linux-gnu.jl:4
in expression starting at /home/daniel/.julia/packages/Xorg_libxcb_jll/nMYKH/src/Xorg_libxcb_jll.jl:2

```

I have already tried updating the `libxslt1.1` package, but that did not resolve the issue – generally, I am not sure which packages to update to provide `Plots.jl` with the right version of the shared object or if this even the right way to go about fixing it.

Maybe someone could point me in the right direction with this?

Many thanks

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [April 7, 2021, 9:18pm UTC](https://discourse.julialang.org/t/loaderror-while-precompiling-plots-jl-on-ubuntu-18-04/58784/2 "2021-04-07T21:18:25Z")

</div>

The problem is that something is loading a system library, `/usr/lib/x86_64-linux-gnu/libxslt.so.1`. How did you install Julia? Does this happen if you try to load julia in a fresh julia session?

---

<div class="post-metadata">

**Author:** ![Anemometer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/anemometer/32/23744_2.png) [@Anemometer](https://discourse.julialang.org/u/Anemometer)\
**Post date:** [April 8, 2021, 10:22am UTC](https://discourse.julialang.org/t/loaderror-while-precompiling-plots-jl-on-ubuntu-18-04/58784/3 "2021-04-08T10:22:09Z")

</div>

> How did you install Julia? Does this happen if you try to load julia in a fresh julia session?

I installed Julia by downloading the [generic x86\_64 Linux tar archive](https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.0-linux-x86_64.tar.gz).  
In a fresh julia session, I do not observe any problems. I can also install various other packages (such as `PlotlyJS.jl` for instance to serve as a backend to `Plot.jl` or `Pluto.jl`), they precompile just fine and can be used normally. My problem only shows up when I try to add `Plots.jl`.

---

<div class="post-metadata">

**Author:** ![CodeLenz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/codelenz/32/3419_2.png) [@CodeLenz](https://discourse.julialang.org/u/CodeLenz)\
**Post date:** [April 8, 2021, 10:43am UTC](https://discourse.julialang.org/t/loaderror-while-precompiling-plots-jl-on-ubuntu-18-04/58784/4 "2021-04-08T10:43:44Z")

</div>

I had a similar problem in Fedora. Somehow I had an old

`export LD_LIBRARY_PATH=/usr/lib64`

in my .bashrc, causing a similar problem. Before that I tried to delete the entire .julia directory, with no luck.

---

<div class="post-metadata">

**Author:** ![Anemometer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/anemometer/32/23744_2.png) [@Anemometer](https://discourse.julialang.org/u/Anemometer)\
**Post date:** [April 8, 2021, 10:50am UTC](https://discourse.julialang.org/t/loaderror-while-precompiling-plots-jl-on-ubuntu-18-04/58784/5 "2021-04-08T10:50:51Z")

</div>

That did actually fix it!  
I had completely forgotten that was still in my `.bashrc`.  
Thank you very much!

---

<div class="post-metadata">

**Author:** ![CodeLenz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/codelenz/32/3419_2.png) [@CodeLenz](https://discourse.julialang.org/u/CodeLenz)\
**Post date:** [April 8, 2021, 11:04am UTC](https://discourse.julialang.org/t/loaderror-while-precompiling-plots-jl-on-ubuntu-18-04/58784/6 "2021-04-08T11:04:04Z")

</div>

Glad you fixed it!
