quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.97k stars 328 forks source link

Quarto unable to locate R #4930

Open s-andrews opened 1 year ago

s-andrews commented 1 year ago

Bug description

Quarto is failing to find the R installation on my machine. This fails from within R studio and when run from a shell. R is in the PATH and works as expected. R works fine within RStudio and compilation with RMarkdown also works.

E:\>set QUARTO_LOG_LEVEL=DEBUG

E:\>quarto check

[>] Checking Quarto installation......OK
      Version: 1.2.335
      Path: C:\Program Files\RStudio\resources\app\bin\quarto\bin
      CodePage: 1252

Loaded deno-dom-native
(-) Checking basic markdown render....[trace] Parsed [Plain [Str "long"]] at line 1
[trace] Parsed [Plain [Str "en"]] at line 1
[trace] Parsed [Plain [Str "true"]] at line 1
[trace] Parsed [Plain [Str "1.2.335"]] at line 1
[trace] Parsed [Plain [Str "Title"]] at line 1
[trace] Parsed [Plain [Str "Table",Space,Str "of",Space,Str "contents"]] at line 1
[trace] Parsed [] at line 5
[trace] Parsed [Header 2 ("header",[],[]) [Str "Header"]] at line 8
Loaded deno-dom-native
[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.9.6
      Path: C:/Program Files/Python39/python.exe
      Jupyter: 5.3.0
      Kernels: python3

(-) Checking Jupyter engine render....Loaded deno-dom-native
(/) Checking Jupyter engine render....[trace] Parsed [Plain [Str "long"]] at line 1
[trace] Parsed [Plain [Str "en"]] at line 1
[trace] Parsed [Plain [Str "true"]] at line 1
[trace] Parsed [Plain [Str "1.2.335"]] at line 1
[trace] Parsed [Plain [Str "Title"]] at line 1
[trace] Parsed [Plain [Str "Table",Space,Str "of",Space,Str "contents"]] at line 1
[trace] Parsed [] at line 4
[trace] Parsed [Header 2 ("header",[],[]) [Str "Header"]] at line 6
[trace] Parsed [CodeBlock ("",["python","cell-code"],[]) "1 + 1"] at line 11
[trace] Parsed [CodeBlock ("",[],[]) "2"] at line 15
[trace] Parsed [Div ("",["cell-output","cell-output-display"],[("execution_ at line 16
[trace] Parsed [Div ("",["cell"],[("execution_count","1")]) [CodeBlock ("", at line 20
Loaded deno-dom-native
[>] Checking Jupyter engine render....OK

[>] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/

So this fails. but R is definitely there and works.

C:\>where R
C:\Users\andrewss\AppData\Local\Programs\R\R-4.2.3\bin\x64\R.exe

C:\>R --version
R version 4.2.3 (2023-03-15 ucrt) -- "Shortstop Beagle"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.

This even fails if I explicitly set QUARTO_R

C:\>set QUARTO_R="C:\Users\andrewss\AppData\Local\Programs\R\R-4.2.3\bin\x64\R.exe"

C:\>echo %QUARTO_R%
"C:\Users\andrewss\AppData\Local\Programs\R\R-4.2.3\bin\x64\R.exe"

C:\>quarto check

[>] Checking Quarto installation......OK
      Version: 1.2.335
      Path: C:\Program Files\RStudio\resources\app\bin\quarto\bin
      CodePage: 1252

[Removed non-R stuff]

[>] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/

There are no files relating to R in the quarto log directory.

C:\Users\andrewss\AppData\Local\quarto\logs>dir
 Volume in drive C has no label.
 Volume Serial Number is 0A21-80E0

 Directory of C:\Users\andrewss\AppData\Local\quarto\logs

22/03/2023  10:10    <DIR>          .
22/03/2023  10:10    <DIR>          ..
22/03/2023  10:10                 0 jupyter-kernel.log
               1 File(s)              0 bytes
               2 Dir(s)  59,993,976,832 bytes free

If it matters, the version of RStudio is 2023.03.0

OS is Windows10.

Checklist

cderv commented 1 year ago

@s-andrews thanks for the report.

  [>] Checking Quarto installation......OK
  Version: 1.2.335
  Path: C:\Program Files\RStudio\resources\app\bin\quarto\bin
  CodePage: 1252

Are you able to try our latest pre-release version ? you can find it at https://quarto.org/docs/download/prerelease.html

Maybe the issue is already fix in it.

Otherwise, what I could think off.

Quarto will use Rscript.exe - can you check this is indeed in your folder ¿

C:\Users\andrewss\AppData\Local\Programs\R\R-4.2.3\bin\x64\

Should be, but just want to be sure.

Also, how did you install R ? It seems to be in %APPDATA% and I wonder how I can reproduce that officialy (without moving my install there).

Anyhow, for now I can't reproduce with latest pre-release 1.3

s-andrews commented 1 year ago

Never mind - it's something to do with my system. I hadn't tried Rscript.exe but it looks like that is broken - I think it's being blocked by our secuity software so even a simple:

Rscript --version

..doesn't produce any output. This is almost certainly why nothing is working.

This isn't a bug in quarto.

If I could make a secondary suggestion through, having a bit more detail about what is happening with the R tests in quarto check would have been really useful. Knowing what file it was looking for and where it was looking would have helped get to the bottom of this.

Thanks for your quick response.

cscheid commented 1 year ago

@s-andrews we hear you. We already have at least another open issue for improving the output of quarto check: https://github.com/quarto-dev/quarto-cli/issues/4845 so this one would also be useful.

allenmanning commented 1 year ago

This may also be related https://github.com/quarto-dev/quarto-cli/issues/1392

cscheid commented 1 year ago

Let's use this one to track the message, since I think #4956 is a duplicate of this.

BB1464 commented 1 year ago

@cderv please I will like to know if there is any solution on this issue yet? I am having the same problem as described here with quarto. I am using a windows machine.

mcanouil commented 1 year ago

@BB1464 Thanks for your interest in this issue. When an issue is fixed, the issue is closed. As you can see, this issue is not closed, thus not fixed. For short, there is no need to ping/tag (randomly) anyone. Be patient. Thank you for your consideration.

BB1464 commented 1 year ago

Thank you for your response @mcanouil, once again my apologies for tagging someone in my initial question!!!

cderv commented 1 year ago

@BB1464 in addition to @mcanouil comment, there is a high chance that your own issue is not related to this one.

In short, this specific issue is :

This issue is still open because it is about improving quarto check output to give more hints on what is happening.

So if your question was: is quarto check updated yet ? The answer is no - this issue will be closed when it does. If your question was: Me too I encounter Unable to locate an installed version of R., then this is quite specific and probably another issue that needs to have its own thread.

Hope it helps

BB1464 commented 1 year ago

Thank you very much @cderv my issues relate to quarto not able to find an installed version of R, I will open a new issue on this just as you suggested!!!