What would be the most platform-independent way of checking whether Python is installed, from R? This question is actually the inverse of Check if R is installed from python.
EDIT:
Sys.which() does not, as far as I have experienced return the path of the Python executable, even though from the Windows command I can directly access python (meaning that the dir of the python executable is added to %PATH% variables?).
Sys.whichnot work?Sys.whichif true but somehow I suspect you are overlooking something. Did you add it to the path after you started R? Did you start R from thecmdline and add python to the path from acmdprocess that had been started before you added python to the path? If you are able to find an instance whereSys.whichdoes not work yet python is on your path then reboot your machine and see if it is still the case. Also tryshell("where python")from the R console.system2('python','-v', stdout = 'stdout.txt', stderr = 'stderr.txt')then check the file or justsystem2('python')