GR.jl icon indicating copy to clipboard operation
GR.jl copied to clipboard

Using GR on travis: can't connect to GKS socket

Open Datseris opened this issue 5 years ago • 4 comments

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.

Datseris avatar Dec 08 '19 23:12 Datseris

https://travis-ci.org/JuliaDynamics/Agents.jl/jobs/622406153#L331

Datseris avatar Dec 08 '19 23:12 Datseris

As shown here, you will have to set the GKSwstype environment when using the GR run-time on Travis.

jheinen avatar Dec 09 '19 08:12 jheinen

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.

lindnemi avatar Feb 17 '20 17:02 lindnemi

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

jheinen avatar Feb 17 '20 17:02 jheinen