When trying to use Julia's GR.jl library on Code Ocean you may encounter 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 GR.jl needs to be configured with the output device, so make sure to set the environment variable in your run.sh/shell script: export GKSwstype=100 , or, if you'd like to set it in your Julia code, ENV["GKSwstype"]="100" before using GR ,

For more information, see this GitHub issue.

Did this answer your question?