Carlos J. Gil Bellosta
2009-Jun-27 15:44 UTC
[Rd] Robust, platform independent method to check for python
Hello, I have been unsuccessfully struggling for a programmatical method to find out whether and where Python is installed. The reason is that I am developing a package that depends on python. On UNIX/UNIX-like systems I can quite safely assume that python is directly callable via system if installed. My main problems is Windows, though... Has anybody faced this problem before? Best regards, Carlos J. Gil Bellosta http://www.datanalytics.com
Gabor Grothendieck
2009-Jun-27 16:01 UTC
[Rd] Robust, platform independent method to check for python
If you can assume its on your path then try this: pth <- sapply(strsplit(Sys.getenv("PATH"), ";"), function(x) file.path(x, "python.exe", fsep = "\\")) pth[file.exists(pth)][1] On Sat, Jun 27, 2009 at 11:44 AM, Carlos J. Gil Bellosta<cgb at datanalytics.com> wrote:> Hello, > > I have been unsuccessfully struggling for a programmatical method to > find out whether and where Python is installed. > > The reason is that I am developing a package that depends on python. > > On UNIX/UNIX-like systems I can quite safely assume that python is > directly callable via system if installed. > > My main problems is Windows, though... > > Has anybody faced this problem before? > > Best regards, > > Carlos J. Gil Bellosta > http://www.datanalytics.com > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >
Romain Francois
2009-Jun-27 17:00 UTC
[Rd] Robust, platform independent method to check for python
I actually have the same question, about ant. I assume this would be what the SystemRequirements field in a package DESCRIPTION is for, but at the moment it seems unused. Is there a plan about this ? Romain On 06/27/2009 05:44 PM, Carlos J. Gil Bellosta wrote:> Hello, > > I have been unsuccessfully struggling for a programmatical method to > find out whether and where Python is installed. > > The reason is that I am developing a package that depends on python. > > On UNIX/UNIX-like systems I can quite safely assume that python is > directly callable via system if installed. > > My main problems is Windows, though... > > Has anybody faced this problem before? > > Best regards, > > Carlos J. Gil Bellosta > http://www.datanalytics.com >-- Romain Francois Independent R Consultant +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr