首页 > 解决方案 > 无法在 R 3.6.3 中安装 lme4 包。在 macOS Catalina 上

问题描述

我无法安装 lme4(它工作正常,然后我离开了一段时间,在此期间进行了一两次更新,现在相同的代码已经停止工作)。

我正在使用的代码是:

install.packages("lme4",  dependencies = TRUE)
library(lme4)

我得到的错误是:

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

Do you want to install from sources the package which needs compilation? (Yes/no/cancel)

第一个问题 - 这是否表明问题出在 lme4 所依赖的 Rcpp 包上?

我输入:

y

第二个问题 - 这是正确的做法吗?

我收到以下消息:

The downloaded binary packages are in
    /var/folders/fr/x0qmcc0d3s1grpw1dc946sch0000gn/T//RtmpCLLS34/downloaded_packages
installing the source package ‘Rcpp’

trying URL 'https://cran.ma.imperial.ac.uk/src/contrib/Rcpp_1.0.4.6.tar.gz'
Content type 'application/x-gzip' length 2751467 bytes (2.6 MB)
==================================================
downloaded 2.6 MB
* 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’

The downloaded source packages are in
    ‘/private/var/folders/fr/x0qmcc0d3s1grpw1dc946sch0000gn/T/RtmpCLLS34/downloaded_packages’
Warning message:
In install.packages("lme4", dependencies = TRUE) :
  installation of package ‘Rcpp’ had non-zero exit status

第三个问题 - 上述消息是什么意思,我该如何解决?

在此先感谢您的帮助!

标签: rmacoslme4install.packages

解决方案


推荐阅读