RStudio keeps adding `/usr/local/bin` to the front of the PATH variable

When I run system commands from RStudio using system("..."), I would like RStudio to use a certain version of Python.

When I open RStudio and set the PATH variables with Sys.setenv(PATH="my_python_path"), this works successfully. To make this the default variable, I tried updating both my ~/.Renviron (Using PATH=...) and ~/.Rprofile (using Sys.setenv("...")) pre-pending the path to the Python I would like to use.

Updating the PATH variables in .Renviron and .Rprofile takes effect, but RStudio nevertheless keeps pre-pending /usr/local/bin to the front of the PATH variable, which directs R to the default system Python in that directory. The Python path I specified comes right after that and does not get used.

Is there a way to make RStudio respect the PATH order that I specified in my .Renviron or .Rprofile?

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.