SolvedPlots.jl Could not load library "libGR.dll"

Something has broken in GR:

julia> using Plots

julia> plot([1:10;])
ERROR: error compiling _plot!: error compiling _display: could not load library "libGR.dll"
The specified module could not be found.

Stacktrace:
 [1] #plot#132(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Array{Int64,1})
 at C:\Users\swan\.julia\packages\Plots\MnXMC\src\plot.jl:57
 [2] plot(::Array{Int64,1}) at C:\Users\swan\.julia\packages\Plots\MnXMC\src\plot.jl:51
 [3] top-level scope at none:0

julia>

I've successfully used GR recently, but something apparently broke when I tried to install Plotly. The installation of Plotly failed, and now I can't use GR either. Any tips on fixing this problem?

17 Answers

✔️Accepted Answer

Please try:

ENV["GRDIR"]=""
Pkg.build("GR")

Other Answers:

Had the same problem under linux:

julia> plot(rand(100))
ERROR: error compiling _plot!: error compiling _display: could not load library "libGR.so"
libGR.so: Kann die Shared-Object-Datei nicht öffnen: Datei oder Verzeichnis nicht gefunden
Stacktrace:
 [1] #plot#136(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Array{Float64,1}) at /home/sebastian/.julia/packages/Plots/ex9On/src/plot.jl:57
 [2] plot(::Array{Float64,1}) at /home/sebastian/.julia/packages/Plots/ex9On/src/plot.jl:51
 [3] top-level scope at none:0

Building the GR package again helped (here in the pkg console - type ] in julia>):

(v0.7) pkg> build GR
  Building GR → `~/.julia/packages/GR/ztzRc/deps/build.log`

Loading Plots.jl again sets the environment variable...

julia> using Plots

julia> ENV["GRDIR"]
"/home/sebastian/.julia/packages/GR/ztzRc/src/../deps/gr"

More Issues: