Can´t load tidyverse


I am not able to load the package tidyverse (it is installed, but not loaded). The following message appears when trying to load it:

> library(tidyverse)
Error: package or namespace load failed for 'tidyverse' in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called 'Rcpp'

So it seems that I need to install the package Rcpp. After I install it the following message appears:

> install.packages("Rcpp")

  There is a binary version available but the source version is later:
     binary  source needs_compilation
Rcpp  1.0.4              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
installing the source package 'Rcpp'

trying URL ''
Content type 'application/x-gzip' length 2751467 bytes (2.6 MB)
downloaded 2.6 MB

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_TIME failed, using "C" 
3: Setting LC_MESSAGES failed, using "C" 
4: Setting LC_MONETARY failed, using "C" 
* installing *source* package 'Rcpp' ...
** package 'Rcpp' successfully unpacked and MD5 sums checked
** using staged installation
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package 'Rcpp'
* removing '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp'
Warning in install.packages :
  installation of package 'Rcpp' had non-zero exit status

The downloaded source packages are in

When I check if the package was installed with these code:

my_packages <- library()$results[,1]

There is no TRUE, so the package wasn´t install.

Can someone please help me? Been dealing with this problem 3 days already, and can´t continue with a course I´m taking.


The easiest solution would be to answer "no" to this question, you would get a precompiled binary version that is a little older but much easier to install.
If you need to install the latest version from source, then you need to install xcode in your system (not in R) and the recommended development tools for MacOS systems.

1 Like

Thanks a lot Andres! This really help. I really appreciate it!

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

1 Like

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