plotly / orca

Command line application for generating static images of interactive plotly charts
MIT License
292 stars 40 forks source link

electron cannot open display when running orca --help (Ubuntu) #386

Open williamlai2 opened 2 years ago

williamlai2 commented 2 years ago

Hi, am running Ubuntu 18.04 and am trying to install orca. It is installed, but I can't get it to work. I have followed the instructions and also looked at previous issues, but it hasn't helped.

I have installed these in ubuntu:

sudo apt-get install nodejs-dev node-gyp libssl1.0-dev
apt install npm
npm install -g electron@6.1.4 orca
sudo apt-get install xvfb

Looking at the location:

root@cmcapvm01:~# which orca
/usr/local/bin/orca
root@cmcapvm01:~# orca --help

(electron:7505): Gtk-WARNING **: 00:58:35.738: cannot open display: :0

And testing the export: https://plotly.com/r/static-image-export/

library(plotly)

if (!require("processx")) install.packages("processx")
fig <- plot_ly(z = ~volcano) %>% add_surface()
orca(fig, "surface-plot.svg")

Error: The orca command-line utility is required for this functionality.

Please follow the installation instructions here -- https://github.com/plotly/orca#installation

I have also tried the headless server configuration:

$ sudo apt-get install xvfb

#!/bin/bash
xvfb-run -a /path/to/orca-X.Y.Z-x86_64.AppImage "$@"

But it still doesn't run.

hailindu commented 2 years ago

Hi @williamlai2, any solution to it? I am having the same issue

williamlai2 commented 2 years ago

No, I haven't found a solution to it yet.