render with Quarto Error

When I try to render the example hello.qmd I get Unable to locate an installed version of R. Install R from https://cloud.r-project.org/

But R works just fine and I can knit other documents.

R.version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          4                           
minor          1.3                         
year           2022                        
month          03                          
day            10                          
svn rev        81868                       
language       R                           
version.string R version 4.1.3 (2022-03-10)
nickname       One Push-Up     

How did you use Quarto ? From within R studio ? From within terminal ?
From within RStudio it should be working fine. Outside, you may need some configuration.
See installation section in the doc Quarto – Using R

Quarto will select a version of R by looking on the system PATH . In addition, on Windows when R is not found on the PATH , the registry will be scanned for the current R version. You can override the version of R used by Quarto by setting the QUARTO_R environment variable.

Thanks for the reply.

  • I am using RStudio 2021.09.2 Build 382
  • I showed the results of R.version. Is there a different way to verify that my system can correctly find R? The answer to this might give the solution to my problem. I use global options to select my R version 4.1.3 (64 bit). I added a QUARTO_R User variable pointing to C:\Program Files\R\R-4.1.3. This did not fix the problem causing the erorr "Unable to locate an installed version of R." Just to restate, I can knit an Rmd file with no problems from RStudio.
  • Also if I use "New File> Quatro Doc" the "the specified procedure could not be found". For my question, I just used the already create "hello.qmd"

Per the documentation, you need to update your RStudio version Quarto – Tutorial: Hello, Quarto saying:

Download and install the latest release of RStudio (v2022.02):

This could be why you have an issue

Thanks,

I am now on 2022.02.1 Build 461
For quarto I am using quarto-0.9.293-win

Same problem

However, now that I updated RStudio, quarto no longer show is no longer an option for "file>new"

Can you share what you see in the Global Option > R Markdown > Quarto ?

It seems ok and found.

You say you can't create a Quarto document ? It is as if the quarto binary is not found.

Quarto is bundle in RStudio. Did you installed it also end added it to your PATH ?

This seems to be the problem I have my path set and even QUARTO_R but my system is not aware of the program. Not sure why

OK I might by dyslexic

Now I get

ERROR: Error executing 'C:\Program Files\Quarto\Rscript': The system cannot find the file specified. (os error 2)

So I am not sure what Quarto_R is supposed to point to: the quarto directory or the r code directory?

Unfortunately I think you misunderstood and messed things up.

First let me just say that if you are using RStudio, you should not need anything else - just install latest version and that should work.

Now, let's go back to what we discussed.

This was your first issue: R not found. So I sent you to the doc Quarto – Using R that mention setting the env variable to help found a R version if not in PATH

You can override the version of R used by Quarto by setting the QUARTO_R environment variable.

Then you said you add issue with RStudio render with Quarto Error - #3 by Harlananelson
It bundles Quarto you should not need to install it elsewhere.

I suggest you follow the doc and clean a bit your environment. If you are touching the environment variable, you should understand to which value you need to set it. e.g QUARTO_R is for the R installation folder for Quarto to use not the QUarto installation. Hence the issue.

Hope it helps

Thanks,

So that gets me to where I started, which was before I had done anything other than install RStudio and it didn't work. I just verified that if I remove the QUARTO_R environment variables, its back to that original error.

So the original problem I noted when first posting is still that same. No Solution.

  • What is in Programm FIles/Quarto/Bin folder that you put in PATH ? Do you still have that ?
  • What does quarto --version return in your OS terminal windows ?
  • If you are using RStudio, I would remove this version of Quarto in Program files.
  • Did you ever try to install the dev version of Quarto using git clone ? If no, then we're good.
  • Which version of RStudio do you use now ? The last release ?
  • What happens if you type quarto in the RStudio terminal ?
  • Install the Quarto package R package from CRAN (install.packages("quarto")) and run quarto::quarto_path(): what is the value ?

Regarding RStudio, you could try last daily version of RStudio : https://dailies.rstudio.com/ just in case if you want

QUARTO_R must be set to the path of R installation. You could try that also.

It is the fist time we see this kind of issue. Everything has been bundled into RStudio so that you just have to follow the documentation.

I have not tried to clone the quarto repository.

$ ls 'C:\Program Files\Quarto\bin'
quarto.cmd  quarto.js  tools/
$ quarto --version
bash: quarto: command not found
 R.version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          4                           
minor          1.3                         
year           2022                        
month          03                          
day            10                          
svn rev        81868                       
language       R                           
version.string R version 4.1.3 (2022-03-10)
nickname       One Push-Up  
$ quarto
bash: quarto: command not found
quarto::quarto_path()
[1] "C:\\PROGRA~1\\Quarto\\bin\\quarto.cmd"

I am not quite sure what is the problem then. I can’t reproduce this on my end.

Can you remove the quarto bin That you installed in program files in case this what is causing the issue ?

Best way would be to start clean from all configs made.

I am finally able to render the hello.qmd.

  • removed all QUARTO paths and system variables
  • uninstalled Quarto.
  • installed the new R 4.2, using administrator so it wouldn't go into my documents folder.
  • Installed RStudio for all users.
  • Reinstalled quarto.

So it works. Reinstalling everything eventually fixed it.

The next project is to figure out how to get rtools working so I can build a package.

I was also able to replicate the original error by putting C:\Program Files\Quarto\bin in my PATH string. If I then took it out of my path string and restarted RStudio, I was able to render again.

I am not able to render to anything but HTML regardless of what is in the YAML. Am unable to use quarto_render. So the problem is that the quarto.cmd in the bin is not working correctly.

Glad it works for you know.

And where does it comes from ? Is there still something not working ?