R EnvironmentError: Could not find Ghostscript on the path. RWebLogo

I had a strange problem that I can’t fix in any way, and I was hoping that someone here could better understand what’s wrong,

I cannot use the RWebLogo package - even run the simplest examples due to the same Ghostscript error.

eg. works:

library(RWebLogo) aln <- c('CCAACCCAA', 'CCAACCCTA', 'AAAGCCTGA', 'TGAACCGGA') weblogo(seqs=aln, file.out='mylogo.pdf') 

Throws this error:

 Traceback (most recent call last): File "/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RWebLogo/extdata/weblogo-3.3/weblogo", line 71, in <module> weblogolib._cli.main() File "/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RWebLogo/extdata/weblogo-3.3/weblogolib/_cli.py", line 82, in main formatter(data, format, opts.fout) File "/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RWebLogo/extdata/weblogo-3.3/weblogolib/__init__.py", line 757, in pdf_formatter gs = GhostscriptAPI() File "/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RWebLogo/extdata/weblogo-3.3/weblogolib/__init__.py", line 196, in __init__ raise EnvironmentError("Could not find Ghostscript on path." EnvironmentError: Could not find Ghostscript on path. There should be either a gs executable or a gswin32c.exe on your system path 

I installed ghostscript ver 9.15 with the / make / install setting in the terminal, and then added the PATH profile to bash and executed it. When I run gs in the terminal, it works, confirming that it is installed on the system path, but the same error still occurs. Even after a reboot.

I tried adding gs to the environment in R directly:

 Sys.setenv(R_GSCMD = "/Applications/ghostscript-9.15/bin/gs") 

which also did not help ... Gives exactly the same error. When I search for R environment, it shows that gs is.

Important version information:

 MAC: OS Yosemite 10.10.1; R version 3.1.1 (2014-07-10); Platform: x86_64-apple-darwin10.8.0 (64-bit); RWebLogo_1.0.3 

Are you aware of any problem that may cause this problem? I am new to programming, so I worry that maybe I missed something basic. I would appreciate any advice. Thanks!

+5
source share
1 answer

I contacted Omar, the author of RWebLogo, and he really helped identify my problems and solve the problem.

First, he advised running RWebLogo on a test sequence on the terminal: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RWebLogo/extdata/weblogo-3.3/weblogo -f test_seqs.txt -o ~ / Desktop / out. pdf -F pdf

Change the base directory (everything that was before extdata / weblogo ...) above the script to be what is shown below in the command below: R /

 system.file(package = 'RWebLogo') 

I ran it and got a new error: lack of numpy. I actually had numpy installed, but without full user privileges. After reinstalling numpy, RWebLogo was successfully launched from the terminal.

However, RStudio throws a GhostScript error. Omar suggested that there was a problem with an older version of RStudio running on Yosemite (I currently have 10.10.1) and sent me a link to an updated version of RStudio where the problem was fixed.

http://www.r-bloggers.com/r-and-rstudio-incompatibility-with-yosemite-mac-os-x-10-10/

I got an updated RStudio, and now everything works fine. Hope this helps someone with a similar problem!

+3
source

Source: https://habr.com/ru/post/1211224/


All Articles