Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load library "libGR.dll" #1720

Closed
orswan opened this issue Sep 5, 2018 · 12 comments

Comments

@orswan
Copy link

commented Sep 5, 2018

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?

@jheinen

This comment has been minimized.

Copy link
Member

commented Sep 5, 2018

Please try:

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

This comment has been minimized.

Copy link

commented Sep 5, 2018

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"
@jheinen

This comment has been minimized.

Copy link
Member

commented Sep 6, 2018

@orswan : Did the package build solve the problem?

@orswan

This comment has been minimized.

Copy link
Author

commented Sep 6, 2018

Actually, before you suggested it, I just did a total reinstall of Julia, including deleting ~/.julia. So I'm afraid I don't know whether your solution would have worked. Sorry!

@orswan orswan closed this Sep 6, 2018

@daniepf

This comment has been minimized.

Copy link

commented Sep 6, 2018

@jheinen
I had the same problem which has been solved by your fix, thanks.

julia> versioninfo()
Julia Version 1.1.0-DEV.196
Commit 8d993569b* (2018-09-05 10:09 UTC)
Platform Info:
OS: Linux (x86_64-redhat-linux)
CPU: Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, haswell)

@metanoid

This comment has been minimized.

Copy link

commented Dec 13, 2018

Please try:

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

This worked for me on Windows. Had to restart julia to get the re-build to take effect, but it works.

@tallakt

This comment has been minimized.

Copy link

commented Jan 23, 2019

FWIW rebuilding worked for me in OSX

@JeffFessler

This comment has been minimized.

Copy link
Contributor

commented Apr 30, 2019

On Mac OSX 10.11.6 with Plots v0.24.0 and Julia 1.1.0 I just got the error

ERROR: error compiling _plot!: error compiling _display: could not load library "libGR.so"
dlopen(libGR.so.dylib, 1): image not found

and ]build GR solved it for me too.

@jasonsychau

This comment has been minimized.

Copy link

commented Jul 31, 2019

My Plots package was working, but it was suddenly not. I started using Plots with a pyplot backend, so I tried using the pyplot backend (pyplot() after using Plots) then restarted my notebook without pyplot to fix the problem.

@jbseby

This comment has been minimized.

Copy link

commented Aug 4, 2019

I have the same problem when using Plots.
I tried the same solution proposed by jheinen and metanoid, i.e.

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

but I receive the following message error:

Updating registry at C:\Users\Jean-Baptiste SEBY\.julia\registries\General
Updating git-repo https://github.com/JuliaRegistries/General.git
GitError(Code:ERROR, Class:Odb, invalid pack file - invalid packfile type in header)

Stacktrace:
[1] macro expansion at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\LibGit2\src\error.jl:101 [inlined]
[2] LibGit2.GitObject(::LibGit2.GitRepo, ::String) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\LibGit2\src\repository.jl:142
[3] get_object_branch(::LibGit2.GitRepo, ::String, ::LibGit2.CachedCredentials) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\Types.jl:873
[4] get_object_branch(::LibGit2.GitRepo, ::Base.SHA1, ::LibGit2.CachedCredentials) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\Types.jl:859
[5] #handle_repos_add!#61(::Bool, ::Nothing, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\Types.jl:754
[6] #handle_repos_add! at .\dict.jl:0 [inlined]
[7] #instantiate#65(::Nothing, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:466
[8] instantiate at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:437 [inlined]
[9] #build#59(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:372
[10] build at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:352 [inlined]
[11] #build#58 at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:350 [inlined]
[12] build at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:350 [inlined]
[13] #build#55 at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:347 [inlined]
[14] build(::String) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:347
[15] top-level scope at In[34]:2

@jheinen

This comment has been minimized.

Copy link
Member

commented Aug 5, 2019

Please try to ] update and/or remove anything under ENV["GRDIR"] and joinpath(ENV["GRDIR"], "../downloads") and restart julia.

@jbseby

This comment has been minimized.

Copy link

commented Aug 7, 2019

Yes, it works! Thank you very much, that's really helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.