pkgr icon indicating copy to clipboard operation
pkgr copied to clipboard

`pkgr inspect` on a New Windows Installation Fails

Open billdenney opened this issue 5 years ago • 6 comments

I just ran the following on Windows as a first test, and it couldn't detect R:

C:\Users\Bill Denney>pkgr inspect
FATA[0000] error getting R version info

R is there in C:\Program Files\R\R-3.6.1

billdenney avatar Jul 24 '19 17:07 billdenney

2 questions:

  1. do you have R in your path
  2. whats you're pkgr.yml look like?

pkgr will, by default, try to launch R by just invoking essentially R.exe --version from the shell and then parses the version info returned. If its not in your path, that will fail.

If you don't have it in your path you can still define it in your pkgr.yml as RPath: path/to/R or as a flag --rpath path/to/R.exe

so you might try

pkgr plan --rpath "C:\Program Files\R\R-3.6.1\R.exe"

dpastoor avatar Jul 24 '19 18:07 dpastoor

As an aside, --rpath is not documented when you just type pkgr at the command prompt. (And, it doesn't seem to work when I try it with an "unknown flag" error.)

billdenney avatar Jul 24 '19 18:07 billdenney

In the end, what I didn't find was that I needed to provide the RPath setting to my yml file. The helpful change here would be to indicate how to provide the R version to pkgr when it is not obvious. An error message like the following would help:

"Error getting R version. Please either put R on your PATH or give the setting RPath in your yml file."

And, as a check prior to checking the R version, it would help to check if the file that you're looking for exists so that a more specific error could be given. Rather than indicating the version could not be found, indicate the R executable could not be found.

billdenney avatar Jul 24 '19 20:07 billdenney

Hi, just want to give my perspective. I also had this problem, and the rpath solutions don't work. As you can see I tried specifying as a flag, to no avail. You can also see that I actually saved the rpath into the pkgr.yml file to no avail. image

I also tried switching the / back to \ (the stupid windows way), but that doesn't work either, it complains of an unknown escape character: image

The only solution that worked was to add R to my path in env. variables

DataStrategist avatar Jul 29 '20 13:07 DataStrategist

For me it helped to add bin in the rpath on line 4 in the pkgr.yml file:

"RPath: "C:/Program Files/R/R-4.0.2/bin/R.exe"".

s1nzy avatar Mar 31 '21 06:03 s1nzy

@DataStrategist sorry for the... extremely delayed response. I'm not completely sure how I missed this. To close the loop on this, your error is different than above, the "found unknown escape" indicates the issue was a parsing error due to the CRLF compared to allt he other LF in the screenshot I'm guessing there was a funky copy-paste error for that. That should resolve if you update that.

dpastoor avatar May 22 '21 11:05 dpastoor