简体   繁体   English

插入包未能安装

[英]Caret package failed to install

I am getting this errors trying to install caret package: 我试图安装插入包时遇到此错误:

ERROR: compilation failed for package ‘ddalpha’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/ddalpha’
Warning in install.packages :
  installation of package ‘ddalpha’ had non-zero exit status
ERROR: dependency ‘ddalpha’ is not available for package ‘recipes’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/recipes’
Warning in install.packages :
  installation of package ‘recipes’ had non-zero exit status
ERROR: dependency ‘recipes’ is not available for package ‘caret’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/caret’
Warning in install.packages :
  installation of package ‘caret’ had non-zero exit status

Any ideas? 有任何想法吗?

install.packages("ddalpha")

It gives the same error: 它给出了同样的错误:

/usr/lib64/R/library/BH/include/boost/exception/exception.hpp:137: error: expected declaration before end of line
make: *** [AlphaProcedure.o] Error 1
ERROR: compilation failed for package ‘ddalpha’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/ddalpha’

I have found a solution. 我找到了解决方案。 I had the same problem. 我有同样的问题。 After installing caret with all its dependencies, ddalpha was not installed. 在安装具有所有依赖项的插入符后,未安装ddalpha。 Then I tried installing the package ddalpha alone. 然后我尝试单独安装包ddalpha。 I got the message: 我收到了消息:

" There is a binary version available but the source version is later: binary source needs_compilation ddalpha 1.2.1 1.3.1 TRUE “有一个二进制版本可用,但源版本稍后:二进制源需求_编译ddalpha 1.2.1 1.3.1 TRUE

Do you want to install from sources the package which needs compilation? 您想从源代码安装需要编译的软件包吗? y/n: n" y / n:n“

Well, if I anwser yes, it doesn't work. 好吧,如果我肯定是的,它不起作用。 But when I answer no, it does work. 但是,当我回答否,它确实有效。 It looks like the new version has some problem, but the previous one works fine. 看起来新版本有一些问题,但前一个版本工作正常。

As Roman indicated in the comments, ddalpha and recipes are dependencies that aren't installed yet. 正如罗马在评论中指出的那样, ddalpharecipes是尚未安装的依赖项。 You can manually install them as follows: 您可以按如下方式手动安装它们:

install.packages(c('ddalpha', 'recipes'))

Alternatively, you can tell the install.packages() command to grab the necessary packages during the install process. 或者,您可以告诉install.packages()命令在安装过程中获取必要的包。

install.packages('caret', dependencies=TRUE)

Or list them explicitly: 或明确列出它们:

install.packages('caret', dependencies=c('ddalpha', 'recipes'))

Or, if you use an IDE such as RStudio , the package manager that's included will automatically handle these dependencies for you. 或者,如果您使用诸如RStudio之类的IDE,则包含的包管理器将自动为您处理这些依赖项。

If these suggestions don't solve the problem, you may try updating your instance of R to the latest (3.4.1 as I write this). 如果这些建议无法解决问题,您可以尝试将R的实例更新为最新版本(我写这篇文章时为3.4.1)。 Also, ddalpha is dependent on the Rcpp package version 0.11.0 or greater, so you may update that package. 此外, ddalpha依赖于Rcpp软件包版本0.11.0或更高版本,因此您可以更新该软件包。

update.packages('Rcpp')

I was facing the same issues, and I had tried almost all the methods mentioned here. 我遇到了同样的问题,我尝试了几乎所有这里提到的方法。 But the only one that worked for me was updating my IDE and that sorted it out. 但唯一适合我的是更新我的IDE并将其整理出来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM