Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t在R中安装插入符号包(在我的Linux机器中)_Linux_R_Gnu_Suse_R Caret - Fatal编程技术网

Can';t在R中安装插入符号包(在我的Linux机器中)

Can';t在R中安装插入符号包(在我的Linux机器中),linux,r,gnu,suse,r-caret,Linux,R,Gnu,Suse,R Caret,尝试在R中安装插入符号包时,我遇到以下错误 g++: error: /tmp/Rtmp2Tos7n/R.INSTALL2e6e30153a74/nloptr/nlopt-2.4.2/lib/libnlopt_cxx.a: No such file or directory make: *** [nloptr.so] Error 1 ERROR: compilation failed for package ‘nloptr’ * removing ‘/rmt/

尝试在R中安装插入符号包时,我遇到以下错误

     g++: error: /tmp/Rtmp2Tos7n/R.INSTALL2e6e30153a74/nloptr/nlopt-2.4.2/lib/libnlopt_cxx.a: 
No such file or directory make: *** [nloptr.so] Error 1
    
    ERROR: compilation failed for package ‘nloptr’
    * removing ‘/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/nloptr’
    Warning in install.packages :
      installation of package ‘nloptr’ had non-zero exit status
    ERROR: dependency ‘nloptr’ is not available for package ‘lme4’
    * removing ‘/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/lme4’
    Warning in install.packages :
      installation of package ‘lme4’ had non-zero exit status
    ERROR: dependency ‘lme4’ is not available for package ‘pbkrtest’
    * removing ‘/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/pbkrtest’
    Warning in install.packages :
      installation of package ‘pbkrtest’ had non-zero exit status
    ERROR: dependency ‘lme4’ is not available for package ‘BradleyTerry2’
    * removing ‘/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/BradleyTerry2’
    Warning in install.packages :
      installation of package ‘BradleyTerry2’ had non-zero exit status
    ERROR: dependency ‘pbkrtest’ is not available for package ‘car’
    * removing ‘/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/car’
    Warning in install.packages :
      installation of package ‘car’ had non-zero exit status
    ERROR: dependencies ‘car’, ‘BradleyTerry2’ are not available for package ‘caret’
    * removing ‘/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/caret’
    Warning in install.packages :
      installation of package ‘caret’ had non-zero exit status
    
    The downloaded source packages are in
        ‘/tmp/RtmpG9dYqn/downloaded_packages’
我研究了另一个有类似问题的问题

这个问题的解决方案是首先安装每个依赖项,但它们都有相同的错误消息。例如:

>install.packages('nloptr')

g++: error: /tmp/RtmpgEn54A/R.INSTALL7015350f0d03/nloptr/nlopt-2.4.2/lib/libnlopt_cxx.a: No such file or directory
make: *** [nloptr.so] Error 1
ERROR: compilation failed for package ‘nloptr’
* removing ‘/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/nloptr’
Warning in install.packages :
  installation of package ‘nloptr’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpG9dYqn/downloaded_packages’
我还尝试更改了
repos
ie.
install.packages('caret',repos')http://cran.rstudio.com/)
但它也不起作用

我的会话信息如下所示:

> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-suse-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_3.1.2

我希望先补充一点意见。2015年1月28日,github中的nloptr包出现错误,可能破坏了编译。我使用了一种变通方法,使用命令从旧版本安装

install.packages("http://cran.r-project.org/src/contrib/Archive/nloptr/nloptr_1.0.0.tar.gz",
                 repos=NULL, type="source")

如本R帮助论坛所述:

将该行添加到src/Makevars文件

     mv .libs lib; \
中间

     make install; \
     ls | grep -v ^include$$ | grep -v ^lib$$ | xargs rm -rf; \

这将删除编译错误,您将能够安装nloptr包。我已经对nloptr_1.0.0.tar.gz进行了测试。

我最近也遇到了nlopt的问题。通过从YaST(或您首选的软件包管理器)安装nlopt-devel及其相关依赖项,可以轻松解决此问题。

我通过从synaptic安装第一个“car”(将过滤器与“cran-car”一起使用)来解决此问题。 然后我用rstudio安装了“插入符号”,但我想它也适用于R。 希望有帮助,
关于

你是第一次安装nlopt库的头吗?@Pascal:我尝试使用命令
install.packages(“nloptr”,repos=”安装它,如本网站所示http://R-Forge.R-project.org)
。这还不够吗?我使用的是linuxNo,如果您没有在Linux系统中安装nlopt库的头文件,则不是这样。在我的机器(Linux Debian)上,有一个libnopt dev包。我相信这就是编译失败的原因,在安装R包之前必须先安装它(使用YaST之类的包管理器,而不是R)。如果您无法找到其他方法,则可能会为您安装依赖项。