In my R script I have to execute an external Python script and I'd use the System()
function.
system("python -m premailer -f daily-report.html -o
ready-weekly-report.html")
But after running this in the R console this is what I get
/usr/bin/python: No module named premailer
If I run the python command from the terminal everything works.
EDIT
premailer
(https://github.com/peterbe/premailer)premailer
on my machine.This is how I fixed this.
Adding the following line to the end of that file, showed me the correct path in Rstudio after restarting my R kernel:
.Internal(Sys.setenv("PATH", paste("/usr/local/bin", Sys.getenv("PATH"), sep=":")))