Can't install Plots on julia-1.6.0

This will try to reset you back to BinaryBuilder:

julia> ENV["GRDIR"] = ""
""

julia> ENV["JULIA_GR_PROVIDER"] = "BinaryBuilder"
"BinaryBuilder"

(@v1.6) pkg> build GR 

If that doesn’t work, try

julia> ENV["GRDIR"] = ""
""

julia> ENV["JULIA_GR_PROVIDER"] = "GR"
"GR"

(@v1.6) pkg> build GR

using GR revealed that GR was not installed. So I did

julia> Pkg.add("GR")
    Updating registry at `~/.julia/registries/General`
   Resolving package versions...
    Updating `~/.julia/environments/v1.6/Project.toml`
  [28b8d3ca] + GR v0.57.3
  No Changes to `~/.julia/environments/v1.6/Manifest.toml`

julia> using Plots
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
Your GR installation is incomplete. Rerunning build step for GR package.
┌ Info: Switching provider to GR due to error in depsfile
└   depsfile = "/home/gibson/.julia/packages/GR/qSS8e/deps/deps.jl"
ERROR: LoadError: LoadError: InitError: Evaluation into the closed module `GR` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `GR` with `eval` during precompilation - don't do this.

Success! I followed your first suggestion to switch back to BinaryBuilder. In the course of building GR, the build system once again changed the GR provider, but this time compilation eventually succeeded.

julia> ENV["GRDIR"] = ""
""

julia> ENV["JULIA_GR_PROVIDER"] = "BinaryBuilder"
"BinaryBuilder"
(@v1.6) pkg> build GR
    Building GR → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/82a03d9c331d181bf33c99c9af04202cc4533d48/build.log`
Precompiling project...
  Progress [========================================>]  3/3
  ✗ Plots
1 dependency successfully precompiled in 12 seconds (110 already precompiled, 1 skipped during auto due to previous errors)
1 dependency errored

julia> using GR
Your GR installation is incomplete. Rerunning build step for GR package.
┌ Info: Switching provider to GR due to error in depsfile
└   depsfile = "/home/gibson/.julia/packages/GR/qSS8e/deps/deps.jl"
    Building GR → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/82a03d9c331d181bf33c99c9af04202cc4533d48/build.log`
Precompiling project...
  Progress [========================================>]  3/3
  ? Plots
1 dependency successfully precompiled in 9 seconds (110 already precompiled, 1 skipped during auto due to previous errors)
1 dependency failed but may be precompilable after restarting julia
[ Info: GR was successfully rebuilt

After restarting

julia> using GR

julia> using Plots
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]

and Plots works. Thank you!

1 Like

Great.

I would be interested in figuring out what the output of the following commands looks like on your machine.

julia> import Pkg; Pkg.add("GR_jll"); import GR_jll
   Resolving package versions...
  No Changes to `C:\Users\kittisopikulm\.julia\environments\v1.6\Project.toml`
  No Changes to `C:\Users\kittisopikulm\.julia\environments\v1.6\Manifest.toml`

It looks like the GR_jll.jl provided binaries are not working whereas the GR provided tarball is working.

Hmmm. Maybe it is that my OS Qt5 version is 5.12 rather than 5.15?

julia> import Pkg; Pkg.add("GR_jll"); import GR_jll
    Updating registry at `~/.julia/registries/General`
   Resolving package versions...
    Updating `~/.julia/environments/v1.6/Project.toml`
  [d2c73de3] + GR_jll v0.57.2+0
  No Changes to `~/.julia/environments/v1.6/Manifest.toml`
[ Info: Precompiling GR_jll [d2c73de3-f751-5644-a686-071e5b155ba9]
ERROR: LoadError: LoadError: InitError: could not load library "/home/gibson/.julia/artifacts/7835210e9722f2d04d4e74972925b5c43d9cfcaa/lib/libQt5Concurrent.so"
/usr/lib64/libQt5Core.so.5: version `Qt_5.15' not found (required by /home/gibson/.julia/artifacts/7835210e9722f2d04d4e74972925b5c43d9cfcaa/lib/libQt5Concurrent.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__()
    @ Qt5Base_jll ~/.julia/packages/Qt5Base_jll/Ks8eF/src/wrappers/x86_64-linux-gnu-cxx11.jl:31
  [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::Nothing)
    @ 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 Qt5Base_jll
in expression starting at /home/gibson/.julia/packages/GR_jll/lXOy4/src/wrappers/x86_64-linux-gnu-cxx11.jl:13
in expression starting at /home/gibson/.julia/packages/GR_jll/lXOy4/src/GR_jll.jl:2
ERROR: Failed to precompile GR_jll [d2c73de3-f751-5644-a686-071e5b155ba9] to /home/gibson/.julia/compiled/v1.6/GR_jll/jl_JK86kc.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
   @ Base ./loading.jl:1360
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1306
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1021
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:914
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:901
gibson@sophist$ rpm -qif /usr/lib64/libQt5Core.so.5
Name        : libQt5Core5
Version     : 5.12.7
Release     : lp152.3.16.1
Architecture: x86_64
Install Date: Mon 21 Dec 2020 12:05:46 PM EST
Group       : Development/Libraries/X11
Size        : 5937956
License     : LGPL-2.1-with-Qt-Company-Qt-exception-1.1 or LGPL-3.0-only
Signature   : RSA/SHA256, Thu 17 Dec 2020 06:04:14 PM EST, Key ID b88b2fd43dbdc284
Source RPM  : libqt5-qtbase-5.12.7-lp152.3.16.1.src.rpm
Build Date  : Thu 17 Dec 2020 05:55:01 PM EST
Build Host  : goat05
Relocations : (not relocatable)
Packager    : http://bugs.opensuse.org
Vendor      : openSUSE
URL         : https://www.qt.io
Summary     : Qt 5 Core Library
Distribution: openSUSE Leap 15.2

Yea that does not look good. It should not be using your system Qt at all actually. It should be using the one from GitHub - JuliaBinaryWrappers/Qt5Base_jll.jl , so you might want to file an issue there.

Pinging @barche and @giordano .

@John_Gibson any chance you are on Mac OS? I reported this bug some days ago because GitHub Actions is consistently failing on Mac OS with a similar error message: [BUG] Precompilation failing on GitHub Actions (MacOS) · Issue #3431 · JuliaPlots/Plots.jl · GitHub

Does the error happen if you try to install Plots in a clean julia session? What’s the value of the LD_LIBRARY_PATH environment variable inside julia?

He’s on openSUSE-15.2 running on Intel.

Check this Slack thread.

Also see LoadError: InitError: Evaluation into the closed module `GR` breaks incremental compilation · Issue #390 · jheinen/GR.jl · GitHub

Yes, I’m running openSUE-15.2 Linux on x86-64. The error happened first on my working julia-1.6.0 and then just the same way when I removed ~/.julia and did Pkg.add(“Plots”) as the first statement after starting Julia.

LD_LIBRARY_PATH in Julia ENV is /usr/lib64:/usr/lib64/mpi/gcc/openmpi/lib64:/home/gibson/channelflow-master/lib:/home/gibson/lib

That’s the issue. Empty the variable when running julia, for example with

LD_LIBRARY_PATH="" julia
1 Like

GR_jll successfully loads and compiles after emptying LD_LIBRARY_PATH as you suggested. Should julia always be run with empty LD_LIBRARY_PATH? Should I have known this?

Starting with LD_LIBRARY_PATH="" julia at bash prompt

julia> ENV["LD_LIBRARY_PATH"]
""
julia> import Pkg; Pkg.add("GR_jll"); import GR_jll
    Updating registry at `~/.julia/registries/General`
   Resolving package versions...
  No Changes to `~/.julia/environments/v1.6/Project.toml`
  No Changes to `~/.julia/environments/v1.6/Manifest.toml`
[ Info: Precompiling GR_jll [d2c73de3-f751-5644-a686-071e5b155ba9]

The official Julia binaries and all the packages ending with _jll vendor the binary libraries, so that users don’t need to figure out how to install them. LD_LIBRARY_PATH overrides that mechanism. So in general I’d recommend to never set LD_LIBRARY_PATH when running julia, unless you perfectly know what you’re doing.

2 Likes

Seems the main issue was solved by @giordano, but just a tip to avoid removing your .julia for this kind of debugging: you can use JULIA_DEPOT_PATH to use a temporary directory, and it will be as if you run a clean julia installation, e.g:

JULIA_DEPOT_PATH=/home/user/tmp/depot_grtest julia
4 Likes

Thanks. I actually just renamed ~/.julia to something and so accomplished the same, but the JULIA_DEPOT_PATH approach is cleaner.

I’ve long used LD_LIBRARY_PATH to help applications find shared libraries, particularly software that I build myself. I will revisit whether this is really necessary.

Thanks everyone for your help!

I would not recommend having LD_LIBRARY_PATH in a general environment. As Mose said, it preempts everything else. I typically have it only in a script for running a specific piece of software if I need it to run with shared libraries that it can either not find or if I need to use with a distinct version of shared libraries. On a HPC system, maybe modules would manage it.

For software you build yourself, there should be other mechanisms for it to find the right libraries. In that case, I would only use LD_LIBRARY_PATH for debugging.

Here’s an older opinion on the topic:

http://xahlee.info/UnixResource_dir/_/ldpath.html

2 Likes

I am on a Windows 10 machine and just came across a similar problem. Everything was working find in a Pluto notebook and then I upgraded to Pluto v0.14.2, and I received a similar error. I then downgraded to v0.14.1 and nothing improved. I have stumbled upon this thread in trying to resolve the problem, tried some of the suggestions and so far no luck.

julia> using Plots
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
Your GR installation is incomplete. Rerunning build step for GR package.
ERROR: LoadError: LoadError: InitError: Evaluation into the closed module `GR` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `GR` with `eval` during precompilation - don't do this.
Stacktrace:
  [1] eval
    @ .\boot.jl:360 [inlined]
  [2] __init__()
    @ GR ~\.julia\packages\GR\qSS8e\src\GR.jl:311
  [3] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base .\loading.jl:674
  [4] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base .\loading.jl:760
  [5] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:998
  [6] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:914
  [7] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:901
  [8] include(mod::Module, _path::String)
    @ Base .\Base.jl:386
  [9] include(x::String)
    @ Plots ~\.julia\packages\Plots\SVksJ\src\Plots.jl:1
 [10] top-level scope
    @ ~\.julia\packages\Plots\SVksJ\src\Plots.jl:218
 [11] include
    @ .\Base.jl:386 [inlined]
 [12] 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:1213
    @ none:1
 [14] eval
    @ .\boot.jl:360 [inlined]
 [15] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [16] top-level scope
    @ none:1
during initialization of module GR
in expression starting at C:\Users\jakez\.julia\packages\Plots\SVksJ\src\backends\gr.jl:6
in expression starting at C:\Users\jakez\.julia\packages\Plots\SVksJ\src\Plots.jl:1
ERROR: Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to C:\Users\jakez\.julia\compiled\v1.6\Plots\jl_ED58.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)
   @ Base .\loading.jl:1360
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base .\loading.jl:1306
 [4] _require(pkg::Base.PkgId)
   @ Base .\loading.jl:1021
 [5] require(uuidkey::Base.PkgId)
   @ Base .\loading.jl:914
 [6] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:901

julia> using GR
Your GR installation is incomplete. Rerunning build step for GR package.
    Building GR → `C:\Users\jakez\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\82a03d9c331d181bf33c99c9af04202cc4533d48\build.log`
  Progress [========================================>]  11/11
  ? Plots
10 dependencies successfully precompiled in 23 seconds (208 already precompiled)
1 dependency failed but may be precompilable after restarting julia
[ Info: GR was successfully rebuilt

julia> using Plots
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
┌ Warning: Module GR with build ID 172841467714401 is missing from the cache.
│ This may mean GR [28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1008
[ Info: Skipping precompilation since __precompile__(false). Importing Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80].

julia> julia> ENV["JULIA_GR_PROVIDER"] = "BinaryBuilder"
ERROR: syntax: "ENV["JULIA_GR_PROVIDER"]" is not a valid function argument name around REPL[4]:1
Stacktrace:
 [1] top-level scope
   @ REPL[4]:1

julia> julia> ENV["GRDIR"] = ""
ERROR: syntax: "ENV["GRDIR"]" is not a valid function argument name around REPL[5]:1
Stacktrace:
 [1] top-level scope
   @ REPL[5]:1

julia> ""
""

julia>

julia> julia> ENV["JULIA_GR_PROVIDER"] = "BinaryBuilder"
ERROR: syntax: "ENV["JULIA_GR_PROVIDER"]" is not a valid function argument name around REPL[7]:1
Stacktrace:
 [1] top-level scope
   @ REPL[7]:1

julia> using GR

julia> using Plots

julia>

julia> LD_LIRARY_PATH
ERROR: UndefVarError: LD_LIRARY_PATH not defined

julia> LD_LIBRARY_PATH
ERROR: UndefVarError: LD_LIBRARY_PATH not defined

julia>

Since you’re on Windows and Windows doesn’t have the concept of LD_LIRARY_PATH, the problem is different. Can you please open a new thread?

Sure

In this kind of situations I empty the compiled directory, i.e. ~/.julia/compiled/v1.6/