All Collections
Tips and Tricks
Installation tips
Fixing GR.jl error `GKS: can't open display on ""`
Fixing GR.jl error `GKS: can't open display on ""`

GR.jl needs to be configured to work on Code Ocean (or any other headless system)

Shahar Zaks avatar
Written by Shahar Zaks
Updated over a week ago

When using Julia's GR.jl library on Code Ocean, you may find the following error:

GKS: can't open display on ""
     Is your DISPLAY environment variable set correctly?
     Did you enable X11 and TCP forwarding?

GKS: Open failed in routine OPEN_WS

On a headless system like Code Ocean GR.jl must be configured with the output device.
 To do so, either:

  •  set the environment variable in a shell script: export GKSwstype=100 ; or

  •  set it in your Julia code: ENV["GKSwstype"]="100", before using GR.

For more information, see this GitHub issue.

Did this answer your question?