Windows R:grImport ghostscript error 'status 127'
Asked Answered
R

1

6

I've installed Ghostscript and grImport in R (Windows, Rstudio). I'm following the tutorial but I immediately get the error,

> library(grImport)
Loading required package: grid
Loading required package: XML
> PostScriptTrace("petal.ps")
Error in PostScriptTrace("petal.ps") : 
  status 127 in running command 'gswin32c.exe -q -dBATCH -dNOPAUSE -sDEVICE=ps2write -sOutputFile=C:\Users\UsrNm\AppData\Local\Temp\RtmpsXXlWA\file1b5c623f48de -sstdout=petal.ps.xml capturepetal.ps'
In addition: Warning message:
running command 'gswin32c.exe -q -dBATCH -dNOPAUSE -sDEVICE=ps2write -sOutputFile=C:\Users\UsrNm\AppData\Local\Temp\RtmpsXXlWA\file1b5c623f48de -sstdout=petal.ps.xml capturepetal.ps' had status 127

Any help would be appreciated.

Rheum answered 7/2, 2016 at 17:15 Comment(2)
I don't know anything about R, but you appear to be executing PostScriptTrace with the argument "petal.ps", however, Ghostscript is being called and asked to process a file called 'capturepetal.ps'. So perhaps its simply caused by the file not existing. It would be possible to say more if you could run Ghostscript without -q and capture the back channel output (stdout seems to be going to petal.ps.xml so you could try looking at that ).Requital
capturepetal.ps is the output file I think.Flieger
F
10

I was having the same problem under Windows 10 and I solved it by manually setting the path to ghostscript:

Sys.setenv(R_GSCMD = normalizePath("C:/gs/gs9.20/bin/gswin32c.exe")) 
Flieger answered 22/2, 2017 at 13:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.