GR.jl
GR.jl copied to clipboard
Using GR on travis: can't connect to GKS socket
Hi, we are attempting to use Plots+GR on travis to make some plots for our documentation. we get the following error immediatelly when we attempt to do a plot:
/home/travis/.julia/packages/GR/oiZD3/src/../deps/gr/bin/gksqt: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application
Did you start 'gksqt'?
GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS
/home/travis/.julia/packages/GR/oiZD3/src/../deps/gr/bin/gksqt: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application
Did you start 'gksqt'?
What's the recommended workaround? We use exclusively the Plots.jl interface, and not use GR directly.
https://travis-ci.org/JuliaDynamics/Agents.jl/jobs/622406153#L331
As shown here, you will have to set the GKSwstype
environment when using the GR run-time on Travis.
I have the same issue with a Github worker (running Ubuntu). This is the error message
/home/runner/.julia/packages/GR/NSt7D/src/../deps/gr/bin/gksqt: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application
Did you start 'gksqt'?
GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS
Saveing (and hosting) the figure is possible, though.
The same fix, i.e. setting ENV["GKSwstype"] = "100"
works.
Please refer to the installation documentation here. For interactive usage on Ubuntu, you will have to install some extra packages:
apt install libxt6 libxrender1 libxext6 libgl1-mesa-glx libqt5widgets5