Amazon EC2上的RStudio上的install.package()不起作用。套件不适用于R版本3.3.3

问题描述 投票:0回答:2

我见过这个:How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?

并通过清单。没运气。我还通过SSH导航到我的库,看看是否有一些LOCK文件或损坏的安装。那里什么都没有。

我确实在Amazon EC2上安装了RStudio,无法安装任何新软件包。我这样做了:https://aws.amazon.com/blogs/big-data/running-r-on-aws/我也和路易斯安斯莱特的AMI一起使用了Ubuntu:http://www.louisaslett.com/RStudio_AMI/

我在两者中都遇到了同样的问题。我已手动下载它们并安装了temp目录下的tar.gz文件。 CRAN存储库似乎没问题,因为install.packages()将tar.gz下载到/ tmp / Rtmp2Rh9Zr / downloaded_pa​​ckages /就好了,但实际的安装过程失败了。

例如,当我运行install.packages(“haven”)时,它说

> install.packages("haven")
Installing package into ‘/home/jblocher/R/x86_64-redhat-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
also installing the dependencies ‘R6’, ‘assertthat’, ‘rlang’, ‘Rcpp’, ‘readr’, ‘hms’, ‘tibble’, ‘BH’

trying URL 'https://cran.rstudio.com/src/contrib/R6_2.2.1.tar.gz'
Content type 'application/x-gzip' length 325641 bytes (318 KB)
==================================================
downloaded 318 KB

trying URL 'https://cran.rstudio.com/src/contrib/assertthat_0.2.0.tar.gz'
Content type 'application/x-gzip' length 11612 bytes (11 KB)
==================================================
downloaded 11 KB

trying URL 'https://cran.rstudio.com/src/contrib/rlang_0.1.1.tar.gz'
Content type 'application/x-gzip' length 201419 bytes (196 KB)
==================================================
downloaded 196 KB

trying URL 'https://cran.rstudio.com/src/contrib/Rcpp_0.12.11.tar.gz'
Content type 'application/x-gzip' length 2485092 bytes (2.4 MB)
==================================================
downloaded 2.4 MB

trying URL 'https://cran.rstudio.com/src/contrib/readr_1.1.1.tar.gz'
Content type 'application/x-gzip' length 233793 bytes (228 KB)
==================================================
downloaded 228 KB

trying URL 'https://cran.rstudio.com/src/contrib/hms_0.3.tar.gz'
Content type 'application/x-gzip' length 7271 bytes
==================================================
downloaded 7271 bytes

trying URL 'https://cran.rstudio.com/src/contrib/tibble_1.3.1.tar.gz'
Content type 'application/x-gzip' length 91235 bytes (89 KB)
==================================================
downloaded 89 KB

trying URL 'https://cran.rstudio.com/src/contrib/BH_1.62.0-1.tar.gz'
Content type 'application/x-gzip' length 10181096 bytes (9.7 MB)
==================================================
downloaded 9.7 MB

trying URL 'https://cran.rstudio.com/src/contrib/haven_1.0.0.tar.gz'
Content type 'application/x-gzip' length 150016 bytes (146 KB)
==================================================
downloaded 146 KB

Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
  installation of package ‘R6’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
  installation of package ‘assertthat’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
  installation of package ‘rlang’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
  installation of package ‘Rcpp’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
  installation of package ‘hms’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
  installation of package ‘BH’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
  installation of package ‘tibble’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
  installation of package ‘readr’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
  installation of package ‘haven’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmpia0VEs/downloaded_packages’

当我使用已下载的软件包安装它时,它说

> install.packages("/tmp/Rtmp2Rh9Zr/downloaded_packages/haven_1.0.0.tar.gz")
Installing package into ‘/home/jblocher/R/x86_64-redhat-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘/tmp/Rtmp2Rh9Zr/downloaded_packages/haven_1.0.0.tar.gz’ is not available (for R version 3.3.3)
r amazon-web-services amazon-ec2 rstudio
2个回答
0
投票

如果您要向install.packages提供存档文件,则可能需要指定repos=NULL

install.packages("/tmp/Rtmp2Rh9Zr/downloaded_packages/haven_1.0.0.tar.gz", repos=NULL)

0
投票

在我的EC2实例上,我在尝试在RStudio上安装软件包时遇到了同样的问题,例如汽车,这涉及到RAM密集的编译。这可以通过添加交换空间来修复,如此处所述

http://www.exegetic.biz/blog/2015/06/amazon-ec2-adding-swap/

© www.soinside.com 2019 - 2024. All rights reserved.