Trouble downloading Quanteda package

Im tryning to download the following packages:

install.packages("quanteda")
install.packages("quanteda.textstats")

It's not working and I am getting this error message:
installing the source packages ‘RcppArmadillo’, ‘quanteda’

trying URL 'https://cran.rstudio.com/src/contrib/RcppArmadillo_0.10.8.1.0.tar.gz'

Content type 'application/x-gzip' length 1364404 bytes (1.3 MB)

==================================================

downloaded 1.3 MB

trying URL 'https://cran.rstudio.com/src/contrib/quanteda_3.2.1.tar.gz'

Content type 'application/x-gzip' length 4187393 bytes (4.0 MB)

==================================================

downloaded 4.0 MB

  • installing source package ‘RcppArmadillo’ ...

** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked

** using staged installation

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

checking for g++... g++

checking whether the C++ compiler works... no

configure: error: in `/private/var/folders/fx/z_rlgzf96bggfvpwt4b3t3640000gn/T/RtmpPUpiiH/R.INSTALLee531fdbb4d5/RcppArmadillo':

configure: error: C++ compiler cannot create executables

See `config.log' for more details

ERROR: configuration failed for package ‘RcppArmadillo’

  • removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/RcppArmadillo’

Warning in install.packages :

installation of package ‘RcppArmadillo’ had non-zero exit status

ERROR: dependency ‘RcppArmadillo’ is not available for package ‘quanteda’

  • removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/quanteda’

Warning in install.packages :

installation of package ‘quanteda’ had non-zero exit status

The downloaded source packages are in

‘/private/var/folders/fx/z_rlgzf96bggfvpwt4b3t3640000gn/T/RtmpplB4Ej/downloaded_packages’

Would really appreciate any help or tips on how to download these packages. Tried everything I can think of...

Julie

Since you are using a quite old R version you are forced to compile packages from source, for that you need to install Xcode in your system (not in R) and the recommended development tools for macOS systems.
https://cran.r-project.org/bin/macosx/tools/

Another option would be to update your R version so you can get access to precompiled binaries that are easier to install.

1 Like

Thank you so much for your fast reply.
I am very new to R studio so really appreciate the help!
I tried downloading the newest version of R studio. However it is still not working.
I am now getting this error code:

 install.packages("quanteda")
also installing the dependency ‘RcppArmadillo’


  There are binary versions available but the source versions are later:

Do you want to install from sources the packages which need compilation? (Yes/no/cancel) 
installing the source packages ‘RcppArmadillo’, ‘quanteda’

trying URL 'https://cran.rstudio.com/src/contrib/RcppArmadillo_0.10.8.1.0.tar.gz'
Content type 'application/x-gzip' length 1364404 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

trying URL 'https://cran.rstudio.com/src/contrib/quanteda_3.2.1.tar.gz'
Content type 'application/x-gzip' length 4187393 bytes (4.0 MB)
==================================================
downloaded 4.0 MB

* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
** using staged installation
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
checking for g++... g++
checking whether the C++ compiler works... no
configure: error: in `/private/var/folders/fx/z_rlgzf96bggfvpwt4b3t3640000gn/T/Rtmp7XrgdZ/R.INSTALL2f04df0dd0/RcppArmadillo':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘RcppArmadillo’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/RcppArmadillo’
Warning in install.packages :
  installation of package ‘RcppArmadillo’ had non-zero exit status
ERROR: dependency ‘RcppArmadillo’ is not available for package ‘quanteda’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/quanteda’
Warning in install.packages :
  installation of package ‘quanteda’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/fx/z_rlgzf96bggfvpwt4b3t3640000gn/T/RtmpWyrjo4/downloaded_packages’
> require("quanteda")
Loading required package: quanteda
Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘quanteda’
> 

Can you think of anything else I can do? I really need this package...
Thank you so much again,
Julie

RStudio is an IDE for the R programming language, you need to update the R interpreter itself not the IDE, you can download the latest R version for your operating system from here

https://cran.r-project.org/bin/macosx/

It worked!!! I am so happy :))) Thank you do much

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