Rstudio an environment (PATH)

Hi,
we are using the R and Rstudio-server on a gpu machine. Using R everything is working fine.
KERAS and TENSORFLOW are working. However using the 2 packages under rstudio is NOT working.
The PATH variable is not the same compared to R (alone).
So R and all normal users have the same PATH variable, Rstudio not ...
Any idea ?
Can we set global(!) those variables ?

Bye, Peer

Typically this happens because users run R from the command prompt which means their shell scripts (.bashrc or .profile or whatever) have run. I suspect that's where the PATH is being set. When R Studio server is run those scripts are not run.

The best way (I think) to set these variables is with .Renviron.site which is run before any R session. You can read more about what's run when here: https://stat.ethz.ch/R-manual/R-devel/library/base/html/Startup.html

Hi,

thanks for the quick response.
I tried

/usr/lib/R/etc# ls -1 Re*
Renviron
Renviron.orig
Renviron.site
Renviron.ucf

and added
Sys.setenv(PATH="/usr/local/cuda/bin:/usr/local/apps/anaconda3/bin:/usr...")

But a restart of rstudio did not change anything. I'm still getting

Sys.getenv("PATH")
[1] "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ```

What's wrong ?

OK, my mistake.
Added to

/etc/R/Renviron.site

the line

PATH="/usr/..."

now everything is working.
Thanks