0

I can not install tidymodels in R studio. By this error, i tried to remove the current rlang, and reinstall it but i still can not install tidymodels package.

Error: package or namespace load failed for ‘tidymodels’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): namespace ‘rlang’ 0.4.7 is already loaded, but >= 0.4.8 is required

Gracetam
  • 19
  • 1
  • 6

2 Answers2

0

I would suggest restarting R, installing rlang from CRAN via install.packages("rlang"), and then restarting R again. At this point, if you type the following in the console:

library(rlang)
sessionInfo() 
#> R version 4.0.3 (2020-10-10)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Mojave 10.14.6
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] rlang_0.4.9
#> 
#> loaded via a namespace (and not attached):
#>  [1] crayon_1.3.4.9000    digest_0.6.27        backports_1.2.0     
#>  [4] lifecycle_0.2.0      reprex_0.3.0.9001    magrittr_2.0.1      
#>  [7] evaluate_0.14        pillar_1.4.7         highr_0.8           
#> [10] stringi_1.5.3        rstudioapi_0.13      fs_1.5.0            
#> [13] vctrs_0.3.5          ellipsis_0.3.1       rmarkdown_2.5.3     
#> [16] styler_1.3.2         tools_4.0.3          stringr_1.4.0       
#> [19] purrr_0.3.4          xfun_0.19            yaml_2.2.1          
#> [22] compiler_4.0.3       pkgconfig_2.0.3      htmltools_0.5.0.9002
#> [25] knitr_1.30           tibble_3.0.4

Created on 2020-12-01 by the reprex package (v0.3.0.9001)

you should see that you have the current rlang version from CRAN. At this point, you should be able to install other packages that depend on rlang, like tidymodels.

Julia Silge
  • 10,848
  • 2
  • 40
  • 48
0

I too had trouble installing tidymodels with R version _ 4.0.4 and R Studio version 1.4.1106.

I had tried updating/re-installing rlang and some other dependencies. BUT I guess for my version of R, I wasn't getting the latest versions.

But finally what worked for me is updating my R version to the latest 4.2.2 (I also updated R Studio, it should not matter but thought of doing so as my R studio keeps reminding of the update)

After this installing tidymodels worked seamlessly.

Dr Nisha Arora
  • 632
  • 1
  • 10
  • 23