reticulate::install_miniconda(force = TRUE) fails with exit code = 2 on windows 11

the installation of reticulate::install_miniconda(force = TRUE) failed
I stepped inside the function and followed it to


where it then fails at

  if (is_windows()) {
    installer <- normalizePath(installer)
    status <- system2(installer, args)

Which can be recreated as:

installer  <- "C:\\Users\\XXXX\\AppData\\Local\\Temp\\Rtmpy08W9m\\Miniconda3-latest-Windows-x86_64.exe"
args <- c("/InstallationType=JustMe","/AddToPath=0","/RegisterPython=0","/NoRegistry=1","/S","/D=C:\\Users\\LAUREN~1\\AppData\\Local\\R-MINI~1")

# I added stdout = TRUE to show the actual error message and generated output
test <- system2(installer, args, stdout = TRUE)
Warning message:
In system2(installer, args, stdout = TRUE) :
  running command '"C:\Users\XXXX\AppData\Local\Temp\Rtmpy08W9m\Miniconda3-latest-Windows-x86_64.exe" /InstallationType=JustMe /AddToPath=0 /RegisterPython=0 /NoRegistry=1 /S /D=C:\Users\XXXX~1\AppData\Local\R-MINI~1' 
had status 2

I checked furthermore the arguments for silent installation and they seem to be OK
mini conda silent installation url

So it looks like the error lies at miniconda. I tried looking them up at github. But I could not find a page which dedicated to Miniconda.

If I run the same command from cmd without arguments the non silent installer is shown...
If I run it with system2 from rstudio the terminal says it is running (shows stop sign on top right)

Any ideas?

Same issue here on Windows 10.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.