Updated StatsPlots and got error messages. How to fix?

I just updated some package and got the following error messages. What can I do about it?

Updating registry at `C:\Users\Ilja\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
 Installed Missings ─── v0.4.2
 Installed DocSeeker ── v0.3.0
 Installed PyPlot ───── v2.8.2
 Installed StatsPlots ─ v0.12.0
 Installed Atom ─────── v0.10.1
 Installed QuantEcon ── v0.16.2
  Updating `C:\Users\Ilja\.julia\environments\v1.2\Project.toml`
  [c52e3926] ↑ Atom v0.9.1 ⇒ v0.10.1
  [682c06a0] ↑ JSON v0.20.0 ⇒ v0.21.0
  [d330b81b] ↑ PyPlot v2.8.1 ⇒ v2.8.2
  [fcd29c91] ↑ QuantEcon v0.16.1 ⇒ v0.16.2
  [f3b207a7] ↑ StatsPlots v0.10.2 ⇒ v0.12.0
  Updating `C:\Users\Ilja\.julia\environments\v1.2\Manifest.toml`
  [c52e3926] ↑ Atom v0.9.1 ⇒ v0.10.1
  [a81c6b42] ↓ Compose v0.7.4 ⇒ v0.7.3
  [33d173f1] ↑ DocSeeker v0.2.0 ⇒ v0.3.0
  [a1bb12fb] ↓ Electron v1.0.0 ⇒ v0.4.0
  [682c06a0] ↑ JSON v0.20.0 ⇒ v0.21.0
  [e1d29d7a] ↑ Missings v0.4.1 ⇒ v0.4.2
  [d330b81b] ↑ PyPlot v2.8.1 ⇒ v2.8.2
  [fcd29c91] ↑ QuantEcon v0.16.1 ⇒ v0.16.2
  [f3b207a7] ↑ StatsPlots v0.10.2 ⇒ v0.12.0
PS C:\Users\Ilja> jlpkg precompile
Precompiling project...
Precompiling Atom
Precompiling StatsPlots
ERROR: LoadError: LoadError: InitError: KeyError: key "GRDIR" not found
Stacktrace:
 [1] (::getfield(Base, Symbol("##457#458")))(::String) at .\env.jl:79
 [2] access_env(::getfield(Base, Symbol("##457#458")), ::String) at .\env.jl:14
 [3] getindex(::Base.EnvDict, ::String) at env.jl:79
 [4] __init__() at C:\Users\Ilja\.julia\packages\GR\ZI5OE\src\GR.jl:231
 [5] _include_from_serialized(::String, ::Array{Any,1}) at .\loading.jl:685
 [6] _require_search_from_serialized(::Base.PkgId, ::String) at .\loading.jl:765
 [7] _require(::Base.PkgId) at .\loading.jl:990
 [8] require(::Base.PkgId) at .\loading.jl:911
 [9] require(::Module, ::Symbol) at .\loading.jl:906
 [10] include(::Module, ::String) at .\boot.jl:328
 [11] include_relative(::Module, ::String) at loading.jl:1094
 [12] include(::Module, ::String) at Base.jl:31
 [13] include(::String) at C:\Users\Ilja\.julia\packages\Plots\Ih71u\src\Plots.jl:1
 [14] top-level scope at C:\Users\Ilja\.julia\packages\Plots\Ih71u\src\Plots.jl:189
 [15] include at .\boot.jl:328 [inlined]
 [16] include_relative(::Module, ::String) at .\loading.jl:1094
 [17] include(::Module, ::String) at .\Base.jl:31
 [18] top-level scope at none:2
 [19] eval(::Module, ::Any) at .\boot.jl:330
 [20] eval(::Expr) at client.jl:432
 [21] top-level scope at none:3
during initialization of module GR
in expression starting at C:\Users\Ilja\.julia\packages\Plots\Ih71u\src\backends\gr.jl:6
in expression starting at C:\Users\Ilja\.julia\packages\Plots\Ih71u\src\Plots.jl:189
ERROR: LoadError: Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to C:\Users\Ilja\.julia\compiled\v1.2\Plots\ld3vC.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1253
 [3] _require(::Base.PkgId) at .\loading.jl:1013
 [4] require(::Base.PkgId) at .\loading.jl:911
 [5] require(::Module, ::Symbol) at .\loading.jl:906
 [6] include at .\boot.jl:328 [inlined]
 [7] include_relative(::Module, ::String) at .\loading.jl:1094
 [8] include(::Module, ::String) at .\Base.jl:31
 [9] top-level scope at none:2
 [10] eval(::Module, ::Any) at .\boot.jl:330
 [11] eval(::Expr) at client.jl:432
 [12] top-level scope at none:3
in expression starting at C:\Users\Ilja\.julia\packages\StatsPlots\Y1rGZ\src\StatsPlots.jl:6
Precompiling Plots
ERROR: LoadError: LoadError: InitError: KeyError: key "GRDIR" not found
Stacktrace:
 [1] (::getfield(Base, Symbol("##457#458")))(::String) at .\env.jl:79
 [2] access_env(::getfield(Base, Symbol("##457#458")), ::String) at .\env.jl:14
 [3] getindex(::Base.EnvDict, ::String) at env.jl:79
 [4] __init__() at C:\Users\Ilja\.julia\packages\GR\ZI5OE\src\GR.jl:231
 [5] _include_from_serialized(::String, ::Array{Any,1}) at .\loading.jl:685
 [6] _require_search_from_serialized(::Base.PkgId, ::String) at .\loading.jl:765
 [7] _require(::Base.PkgId) at .\loading.jl:990
 [8] require(::Base.PkgId) at .\loading.jl:911
 [9] require(::Module, ::Symbol) at .\loading.jl:906
 [10] include(::Module, ::String) at .\boot.jl:328
 [11] include_relative(::Module, ::String) at loading.jl:1094
 [12] include(::Module, ::String) at Base.jl:31
 [13] include(::String) at C:\Users\Ilja\.julia\packages\Plots\Ih71u\src\Plots.jl:1
 [14] top-level scope at C:\Users\Ilja\.julia\packages\Plots\Ih71u\src\Plots.jl:189
 [15] include at .\boot.jl:328 [inlined]
 [16] include_relative(::Module, ::String) at .\loading.jl:1094
 [17] include(::Module, ::String) at .\Base.jl:31
 [18] top-level scope at none:2
 [19] eval(::Module, ::Any) at .\boot.jl:330
 [20] eval(::Expr) at client.jl:432
 [21] top-level scope at none:3
during initialization of module GR
in expression starting at C:\Users\Ilja\.julia\packages\Plots\Ih71u\src\backends\gr.jl:6
in expression starting at C:\Users\Ilja\.julia\packages\Plots\Ih71u\src\Plots.jl:189
Precompiling PyPlot
Precompiling QuantEcon

Seems to be an issue with the GR backend to StatsPlots - does it work with normal Plots.jl?

Nope, it does not work:

using Plots
gr()
plot(randn(100))

error compiling _plot!: error compiling _display: could not load library "libGR.dll"
The specified module could not be found.

#plot#133(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(plot), ::Array{Float64,1}) at plot.jl:57
plot(::Array{Float64,1}) at plot.jl:51
top-level scope at untitled-df646afad90dae5f07799c30e74d9a93:3

It works now after I did pkg> build GR

1 Like