安装AWS S3 R软件包

时间:2019-04-25 18:51:59

标签: r amazon-web-services amazon-s3

我正在尝试在R上安装S3软件包,以便将cv输出保存到我​​正在运行的回归中。我尝试安装S3软件包以将Rstudio服务器链接到S3,但是没有运气。这是我在尝试安装aws.s3软件包时收到的错误:

> install.packages("aws.s3", repos = c("cloudyr" = "http://cloudyr.github.io/drat"))
Installing package into ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependency ‘httr’ is not available
trying URL 'http://cloudyr.github.io/drat/src/contrib/aws.s3_0.3.20.tar.gz'
Content type 'application/gzip' length 47438 bytes (46 KB)
==================================================
downloaded 46 KB

ERROR: dependency ‘httr’ is not available for package ‘aws.s3’
* removing ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4/aws.s3’
Warning in install.packages :
  installation of package ‘aws.s3’ had non-zero exit status

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

然后我尝试安装httr依赖软件包,但也没有成功。

> install.packages("httr")
Installing package into ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘openssl’

trying URL 'https://cran.rstudio.com/src/contrib/openssl_1.3.tar.gz'
Content type 'application/x-gzip' length 1218896 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

trying URL 'https://cran.rstudio.com/src/contrib/httr_1.4.0.tar.gz'
Content type 'application/x-gzip' length 156356 bytes (152 KB)
==================================================
downloaded 152 KB

* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because openssl was not found. Try installing:
 * deb: libssl-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev (Solaris)
 * brew: openssl@1.1 (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘openssl’
* removing ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4/openssl’
Warning in install.packages :
  installation of package ‘openssl’ had non-zero exit status
ERROR: dependency ‘openssl’ is not available for package ‘httr’
* removing ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4/httr’
Warning in install.packages :
  installation of package ‘httr’ had non-zero exit status

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

类似,在安装openssl软件包时。我的EC2实例类型是t2.medium。

1 个答案:

答案 0 :(得分:0)

在这里,在安装cloudyr的aws.s3软件包之前,需要一些操作系统和一些R依赖项。

aws.s3依赖于三个R包:curlhttrxml。这些依次取决于libssllibxml2libcurl4-openssl OS库。

在全新的EC2实例上,假设使用Ubuntu机器(当然,还有Fedora / CentOS / RedHat发行版的等效yum软件包),则必须首先安装OS依赖项:

sudo apt-get install -y build-essential libssl-dev libxml2-dev libcurl4-openssl-dev

然后,您可以按照指定的顺序安装以下R软件包:

install.packages('curl')
install.packages('httr')
install.packages('xml2')
install.packages("aws.s3", repos = c("cloudyr" = "http://cloudyr.github.io/drat"))

希望这会有所帮助

相关问题