Issues installing tidyverse package

2.9k views Asked by At

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

2

There are 2 answers

0
Virgile Korsec On

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 !

0
Caesarius On
    >  install.packages("tidyverse", dependencies = TRUE)

Installing package into ‘/usr/local/lib/R/4.3/site-library’
(as ‘lib’ is unspecified)
also installing the dependency ‘ragg’

trying URL 'https://cran.rstudio.com/src/contrib/ragg_1.2.7.tar.gz'
Content type 'application/x-gzip' length 425500 bytes (415 KB)
==================================================
downloaded 415 KB

trying URL 'https://cran.rstudio.com/src/contrib/tidyverse_2.0.0.tar.gz'
Content type 'application/x-gzip' length 704618 bytes (688 KB)
==================================================
downloaded 688 KB

<<<* installing *source* package ‘ragg’ ...
<<<** package ‘ragg’ successfully unpacked and MD5 sums checked
<<<** using staged installation
Package libtiff-4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtiff-4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libtiff-4' found
Package libtiff-4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtiff-4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libtiff-4' found
Homebrew 4.2.1
Using PKG_CFLAGS=-I/usr/local/include -I/usr/local/include/freetype2
Using PKG_LIBS=-L/usr/local/lib -lfreetype -lpng16 -ltiff -lz -ljpeg -lbz2
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find one of --static freetype2 libpng libtiff-4 libjpeg. Try installing:
 deb: libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev (Debian, Ubuntu, etc)
   rpm: freetype-devel libpng-devel libtiff-devel libjpeg-devel (Fedora, CentOS, RHEL)
   csw: libfreetype_dev libpng16_dev libtiff_dev libjpeg_dev (Solaris)
If --static freetype2 libpng libtiff-4 libjpeg is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a --static freetype2 libpng libtiff-4 libjpeg.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:3:10: fatal error: 'tiffio.h' file not found
#include <tiffio.h>
         ^~~~~~~~~~
1 error generated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘ragg’
 removing ‘/usr/local/lib/R/4.3/site-library/ragg’
Warning in install.packages :
  installation of package ‘ragg’ had non-zero exit status
ERROR: dependency ‘ragg’ is not available for package ‘tidyverse’
 removing ‘/usr/local/lib/R/4.3/site-library/tidyverse’
Warning in install.packages :
  installation of package ‘tidyverse’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/sy/2wftyh396f36nkzsls0g4_6r0000gn/T/Rtmpd8NLOm/downloaded_packages’
    >  library(textshaping)
    >  library(tidyverse)
Error in library(tidyverse) : there is no package called ‘tidyverse’

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Above error was generated while working on MacOs Catalina version 10.15.7
I <<<<brew install textshaping>>>> and I <<<<brew install libtiff>>>> . There is no libtiff-4 available for brew as suggested by the error message. It is not possible at least in Dec2023 to <<<<brew install tidyverse>>>.

So, if you are on an older MacOs versions and struggling installing tidyverse the above may be a solution to achieve this 
    library(tidyverse)
     ── Attaching core tidyverse packages