I have installed a python program using the Terminal Tab. I then added the path to the installed library to the environment PATH; and checked that I can find the installed program
python3 -m pip install --user --upgrade cutadapt
PATH=$HOME/bin:"$PATH"
which cutadapt
And that works. The problem is when I try to use that program through an R script
system2("which", args = "cutadapt")
then it can't find it.
Any best practices out there to use unix installed programs with Rstudio cloud?
Thanks for the reply - The result is interesting: running echo $SHELL from the Terminal Tab (within Rstudio cloud) returns /bin/bash;
system2("echo", "$SHELL") returns nothing
In some of my Rstudiocloud projects I have a .bash_profile with a PATH variable, but not in other projects. It does not seem to make a difference on whether system2 returns the same paths that directly looking at the terminal.
I just run system2("whoami") and it returned
rstudio-user
I looked at the environment vars in both cases - I used system2("printenv")
and printenv from the terminal tab in Rstudiocloud.
I made them into a df and these are the entries that are different between the two
Cool! The path sits in a .bash_profile file I created in the project root (/cloud/project/.bash_profile), but system2("export", ".bash_profile") does not work.