'How to run orca from R?
I have installed orca using npm and if I go to my R project folder and type orca --version, I see 1.3.1.
In Rstudio I have installed the processx package. Having produced a fig with plot_ly if I try capture a plot I see the following
orca(fig, 'temp.svg')
Error in processx::run("orca", "-h") :
System command 'orca' failed, exit status: 127, stderr:
E> env: node: No such file or directory
Type .Last.error.trace to see where the error occurred
If I type .Last.error.trace I see the following
Stack trace:
1. plotly:::orca(fig, "temp.svg")
2. plotly:::orca_available()
3. plotly:::correct_orca()
4. processx::run("orca", "-h")
5. throw(new_process_error(res, call = sys.call(), echo = echo, ...
x System command 'orca' failed, exit status: 127, stderr:
E> env: node: No such file or directory
I have restarted Rstudio and restarted R, but still see the problem. How do I fix this?
Solution 1:[1]
From your description, I assume that you already installed both orca and processx library. The next steps are:
- install standalone Orca desktop app and
- Makes the path of the installation accessible from Rstudio
You may skip the step one and directly go to the second step since you mentioned that you already installed the desktop app using NPM. However, I recommend you to reinstall it as I did.
For doing step one with regular installation method, you can download Orca installer (windows-release.zip) from github: orca installer. Then, install the app inside the zip folder.
After installing it, you can go to the second step by doing:
- Find your Orca app displayed on your desktop, right-click on the orca icon and select Properties from the context menu.
- From the Shortcut tab, copy the directory in the Start in field. (you need this for adding the app's PATH later in step-7).
- hit "windows logo + X" to open Power-User menu, go to SETTING
- go to ABOUT, click the Advanced system settings
- click the Advanced tab, then click the Environment Variables button near the bottom of that tab
- highlight the Path variable in the SYSTEM VARIABLES section and click the Edit button
- Add path lines by paste your installation path (from step-2)
Restart your PC to ensure everything runs smoothly.
Finally, you can try your code again in Rstudio. Hope this can help some confusions.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
