0

I am trying to use RStudio Server to run a package (CNV-CLinViewer) through Windows Subsystem for Linux. All R packages required could be installed except for bedtoolsr, which requires bedtools (not an R package). I have bedtools installed on my WSL and the folder is part of my PATH.

For some reason, RStudio does not "see" it, however. I tried to manually set the path to bedtools using options(bedtools.path = "/home/usr/anaconda3/bin/bedtools"), but that did not help either.

Does anybody have a tip on how to make it visible to RStudio Server?

Thanks

jordimaggi
  • 99
  • 1
  • 11
  • Which PATH variable did you change? Both Windows and your WSL OS will have it's own PATH environment variable. Make sure you update the one in WSL. And then make sure you relaunch the server after the update so it will inherit the new environment variable. – MrFlick Aug 11 '22 at 13:10
  • I did not change anything on my windows. I use RStudio exclusively on WSL. – jordimaggi Aug 11 '22 at 14:00
  • So if you run `Sys.getenv("PATH")` from your RStudio session, do you see the value you expect? If not, how exactly did you set your PATH? – MrFlick Aug 11 '22 at 14:05
  • It does not. For some reason, it does not update it. I did try to restart the server. How do I change this behaviour? – jordimaggi Aug 11 '22 at 14:09
  • You really haven't provided a lot of details on what exactly you are doing. How are you getting the PATH variable? How are you launching the server? Are you doing both in the same terminal session? – MrFlick Aug 11 '22 at 14:11
  • The PATH variable from the terminal differs from the one returned by RStudio when I run `Sys.getend("PATH")`. From terminal: `/home/analyst/anaconda3/bin:/home/analyst/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/analyst/.dotnet/tools` From RStudio: `"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/usr/lib/rstudio-server/bin/quarto/bin:/usr/lib/rstudio-server/bin/postback:/usr/lib/rstudio-server/bin/postback:/usr/lib/rstudio-server/bin/postback"` Server launched from the terminal – jordimaggi Aug 11 '22 at 14:14

1 Answers1

0

The issue was that the PATH variable was on RStudio was different from the one displayed on the terminal (it was missing /home/analyst/anaconda3/bin).

Editing the PATH variable on RStudio fixed it. I edited the variable like this: old_path <- Sys.getenv("PATH")

Sys.setenv(PATH = paste(old_path, "/home/analyst/anaconda3/bin", sep = ":"))

jordimaggi
  • 99
  • 1
  • 11