1

I'm an R user for some years now, and today, I opened a new R project, and tidyverse could'nt be installed.

install.packages("tidyverse")

The error message is :

Error : install of package 'processx' failed [error code 1]
In addition: Warning message:
1: Dans system2(R(), args, stdout = TRUE, stderr = TRUE) :
  l'exécution de la commande ''/Library/Frameworks/R.framework/Resources/bin/R' CMD config CC 2>&1' renvoie un statut 1
2: Dans if (eval(cond, envir = environment(dot))) return(eval(expr, envir = environment(dot))) :
  la condition a une longueur > 1 et seul le premier élément est utilisé
3: Dans if (eval(cond, envir = environment(dot))) return(eval(expr, envir = environment(dot))) :
  la condition a une longueur > 1 et seul le premier élément est utilisé
Traceback (most recent calls last):
14: sourceWithProgress(script = "/var/folders/yw/_p67kkw161v0mh0cd92qcbhw0000gn/T/8163-6b53-10ca-cf6c", 
        encoding = "UTF-8", con = stdout(), importRdata = NULL, exportRdata = NULL)
13: eval(statements[[idx]], envir = sourceEnv)
12: eval(statements[[idx]], envir = sourceEnv)
11: renv::install("reprex")
10: renv_install_impl(records)
 9: renv_install_staged(records)
 8: renv_install_default(records)
 7: handler(package, renv_install_package(record))
 6: renv_install_package(record)
 5: withCallingHandlers(renv_install_package_impl(record), error = function(e) {
        vwritef("\tFAILED")
        writef(e$output)
    })
 4: renv_install_package_impl(record)
 3: r_cmd_install(package, path)
 2: r_exec_error(package, output, "install", status)
 1: stop(error)
Exécution arrêtée

Since the error seems to be related with "processx", I tried to download this package as well, as it was suggested here :

install.packages("processx")

But the same error occured :

Error : install of package 'processx' failed [error code 1]
In addition: Warning message:
1: Dans system2(R(), args, stdout = TRUE, stderr = TRUE) :
  l'exécution de la commande ''/Library/Frameworks/R.framework/Resources/bin/R' CMD config CC 2>&1' renvoie un statut 1
2: Dans if (eval(cond, envir = environment(dot))) return(eval(expr, envir = environment(dot))) :
  la condition a une longueur > 1 et seul le premier élément est utilisé
3: Dans if (eval(cond, envir = environment(dot))) return(eval(expr, envir = environment(dot))) :
  la condition a une longueur > 1 et seul le premier élément est utilisé

About other packages :

  • some can still be installed, like "ggplot2"
  • but some other can not, like "callr"

It may have no association with my problem, but yesterday, I uploaded :

  • my macOS version to macOS Monterrey 12.4
  • and so on for my latest R version (from R-4.1.0 to R-4.2.0)
  • and my RStudio version (from RStudio-1.4.1717 to RStudio-2022.02.3-492) I tried uninstalling and reinstalling one, the other one, and both, and the issue stays the same.

I've been looking for some solution over the clock, so thank you for your help, if you can !

Regards

Virgile

  • This error you are getting is new in R 4.2.0 (I think, my French is not so good). Not sure why it is failing though. – Axeman Jun 10 '22 at 19:01
  • `find("install.packages")` ? Results of `sessionInfo()` ? – Ben Bolker Jun 10 '22 at 21:17
  • What version of `renv` do you have installed? You can also try to bypass `renv`'s installation machinery with `utils::install.packages("tidyverse")`. – Kevin Ushey Jun 11 '22 at 02:49
  • 2
    It's also possible (if you just updated macOS) that you need to re-install command line tools; if so, try running `xcode-select --install` from the command line to force an update. – Kevin Ushey Jun 11 '22 at 03:13

1 Answers1

2

Thank you for all your responses.

@Kevin Ushey, the version is "renv_0.14.0". Both your advice, first xcode-select --install, then utils::install.packages("tidyverse") worked out pefectly...although I didnt understand the link with "renv".

So @Ben Bolker, as you can see, problem solved :

find("install.packages")
[1] "renv:shims"    "package:utils"

Then :

sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS 12.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/fr_FR.UTF-8

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
 [1] MASS_7.3-54     DBI_1.1.2       odbc_1.3.3      callr_3.7.0     processx_3.6.0  forcats_0.5.1  
 [7] stringr_1.4.0   dplyr_1.0.9     purrr_0.3.4     readr_2.1.2     tidyr_1.2.0     tibble_3.1.7   
[13] ggplot2_3.3.6   tidyverse_1.3.1

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.2 haven_2.5.0      colorspace_2.0-3 vctrs_0.4.1      generics_0.1.2  
 [6] blob_1.2.3       utf8_1.2.2       rlang_1.0.2      pillar_1.7.0     glue_1.6.2      
[11] withr_2.5.0      bit64_4.0.5      dbplyr_2.2.0     modelr_0.1.8     readxl_1.4.0    
[16] lifecycle_1.0.1  munsell_0.5.0    gtable_0.3.0     cellranger_1.1.0 rvest_1.0.2     
[21] tzdb_0.3.0       ps_1.7.0         fansi_1.0.3      broom_0.8.0      Rcpp_1.0.8.3    
[26] renv_0.14.0      scales_1.2.0     backports_1.4.1  jsonlite_1.8.0   fs_1.5.2        
[31] bit_4.0.4        hms_1.1.1        stringi_1.7.6    grid_4.1.0       cli_3.3.0       
[36] tools_4.1.0      magrittr_2.0.3   crayon_1.5.1     pkgconfig_2.0.3  ellipsis_0.3.2  
[41] xml2_1.3.3       reprex_2.0.1     lubridate_1.8.0  assertthat_0.2.1 httr_1.4.3      
[46] rstudioapi_0.13  R6_2.5.1         compiler_4.1.0  

You rock !