ERROR: loading failed for 'i386' tidyverse

Dear all,

I have been geting a weired behaviour in my version of R recently. When I try to install a package such as tidyverse or others, I keep getting this error.

install.packages("tidyverse")
Installing package into ‘C:/Users/User/OneDrive - Newcastle University/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
          binary source needs_compilation
tidyverse  1.3.1  1.3.2             FALSE

installing the source package ‘tidyverse’

trying URL 'https://cran.rstudio.com/src/contrib/tidyverse_1.3.2.tar.gz'
Content type 'application/x-gzip' length 702514 bytes (686 KB)
downloaded 686 KB

* installing *source* package 'tidyverse' ...
** package 'tidyverse' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'tidyverse'
    finding HTML links ... done
    tidyverse-package                       html  
    tidyverse_conflicts                     html  
    tidyverse_deps                          html  
    tidyverse_logo                          html  
    tidyverse_packages                      html  
    tidyverse_sitrep                        html  
    tidyverse_update                        html  
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
*** arch - i386
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/User/OneDrive - Newcastle University/Documents/R/win-library/4.0/tidyverse'
* restoring previous 'C:/Users/User/OneDrive - Newcastle University/Documents/R/win-library/4.0/tidyverse'
Warning in install.packages :
  installation of package ‘tidyverse’ had non-zero exit status

This is the session info.

R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252    LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                            LC_TIME=English_United Kingdom.1252    

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

other attached packages:
[1] brms_2.17.0    Rcpp_1.0.8     margins_0.3.26

loaded via a namespace (and not attached):
  [1] backports_1.4.1      plyr_1.8.6           igraph_1.2.11        splines_4.0.5        crosstalk_1.2.0      ggplot2_3.3.5       
  [7] TH.data_1.1-0        rstantools_2.2.0     inline_0.3.19        digest_0.6.29        htmltools_0.5.2      fansi_1.0.2         
 [13] magrittr_2.0.2       checkmate_2.0.0      remotes_2.4.2        RcppParallel_5.1.5   matrixStats_0.61.0   xts_0.12.1          
 [19] sandwich_3.0-1       prettyunits_1.1.1    strucchange_1.5-2    colorspace_2.0-3     ggdist_3.1.1         dplyr_1.0.8         
 [25] callr_3.7.0          crayon_1.5.1         libcoin_1.0-9        lme4_1.1-28          survival_3.3-1       zoo_1.8-9           
 [31] glue_1.6.2           gtable_0.3.0         emmeans_1.7.3        distributional_0.3.0 pkgbuild_1.3.1       rstan_2.21.3        
 [37] abind_1.4-5          scales_1.2.0         mvtnorm_1.1-3        DBI_1.1.2            miniUI_0.1.1.1       xtable_1.8-4        
 [43] performance_0.9.0    diffobj_0.3.5        stats4_4.0.5         prediction_0.3.14    StanHeaders_2.21.0-7 DT_0.22             
 [49] datawizard_0.4.0     htmlwidgets_1.5.4    threejs_0.3.3        posterior_1.2.1      modeltools_0.2-23    ellipsis_0.3.2      
 [55] pkgconfig_2.0.3      loo_2.5.1            farver_2.1.0         utf8_1.2.2           tidyselect_1.1.2     labeling_0.4.2      
 [61] rlang_1.0.2          reshape2_1.4.4       later_1.3.0          effectsize_0.6.0.1   munsell_0.5.0        tools_4.0.5         
 [67] cli_3.2.0            party_1.3-9          generics_0.1.2       broom_0.8.0          ggridges_0.5.3       stringr_1.4.0       
 [73] fastmap_1.1.0        processx_3.5.2       purrr_0.3.4          coin_1.4-2           nlme_3.1-155         mime_0.12           
 [79] projpred_2.0.2       rstanarm_2.21.1      compiler_4.0.5       bayesplot_1.9.0      shinythemes_1.2.0    rstudioapi_0.13     
 [85] curl_4.3.2           gamm4_0.2-6          tibble_3.1.6         stringi_1.7.6        ps_1.6.0             parameters_0.17.0   
 [91] Brobdingnag_1.2-7    lattice_0.20-44      Matrix_1.3-3         nloptr_2.0.0         markdown_1.1         shinyjs_2.1.0       
 [97] tensorA_0.36.2       vctrs_0.3.8          pillar_1.7.0         lifecycle_1.0.1      bridgesampling_1.1-2 estimability_1.3    
[103] data.table_1.14.2    insight_0.17.0       httpuv_1.6.5         R6_2.5.1             promises_1.2.0.1     gridExtra_2.3       
[109] codetools_0.2-18     boot_1.3-28          colourpicker_1.1.1   MASS_7.3-55          gtools_3.9.2         assertthat_0.2.1    
[115] rprojroot_2.0.3      withr_2.5.0          shinystan_2.6.0      multcomp_1.4-18      mgcv_1.8-40          bayestestR_0.11.5   
[121] parallel_4.0.5       grid_4.0.5           tidyr_1.2.0          coda_0.19-4          minqa_1.2.4          shiny_1.7.1         
[127] lubridate_1.8.0      base64enc_0.1-3      dygraphs_1.1.1.6 

This has been a consistent issue for the past month, not sure if I'm missing something.
I'd highly appreciate your input.
Many thanks in advance!

It seems you are installing packages from source for R 32 and 64-bit versions but you do not have a 32-bit version of RTools installed in your system.

Having the 32-bit version of R installed in your system is not necessary unless you absolutely needed for some specific reason like interacting with a legacy odbc driver.

Also, R has known issues with cloud-synced folders (OneDrive in your case), I recommend you to set your package library in a non-synced folder.

1 Like

Many thanks @andresrcs for this. It is indeed what I'v been going through. In order to solve this issue, what is practical advice that you could provide to avoid this in future?

Many thanks for your time!

Well, it depends on your requirements. If you need the 32-bit R version, then you also need to install RTools 32-bit and updating R is not an option since the latest version is 64-bit only. If you don't need the 32-bit version you could simply uninstall it, or even better, update your R version so you can use precompiled binaries avoiding compilation.

In any case, it would be better if you change your package library to a non-synced folder. You can change the default library folder by setting your R_LIBS_SITE environmental variable in a .Reviron or .Rprofile file. For example:

# In a .Renviron file you can set it by adding a line like this one with the desired location 
R_LIBS_SITE="C:\\Program Files\\R\\R-4.1.2\\library"

For a more detailed explanation, you can read this blog post

1 Like

It seems working now!
Many thanks!

This topic was automatically closed 7 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.