简体   繁体   English

安装 AWS S3 R 包

[英]Installing AWS S3 R package

I am trying to install the S3 package on R inorder to save csv output on regressions I am running.我正在尝试在 R 上安装 S3 包,以便在我正在运行的回归中保存 csv 输出。 I tried to install the S3 package to link the Rstudio server to S3 but with no luck.我尝试安装 S3 包以将 Rstudio 服务器链接到 S3,但没有成功。 This is the error I recieved when trying to install the aws.s3 package:这是我在尝试安装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’

I then tried installing the httr depence package but with no success as well.然后我尝试安装httr depence 包但也没有成功。

> 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’

Likewise when installing the openssl package.安装openssl包时也是如此。 My EC2 instance type is a t2.medium.我的 EC2 实例类型是 t2.medium。

Here, both some OS and some R dependencies are needed before installing the aws.s3 package of cloudyr .在这里,在安装 cloudyr 的cloudyr包之前,需要一些操作系统和一些 R 依赖项。

aws.s3 depends on three R packages: curl , httr and xml . aws.s3 依赖于三个 R 包: curlhttrxml These depend, in turn, on the libssl , libxml2 and libcurl4-openssl OS libraries.这些依次依赖于libssllibxml2libcurl4-openssl操作系统库。

On a fresh new EC2 instance, assuming a Ubuntu box (but of course there are the equivalent yum packages for Fedora/CentOS/RedHat distros), OS dependences have to be installed for first:在一个全新的 EC2 实例上,假设是一个 Ubuntu 盒子(但当然有适用于 Fedora/CentOS/RedHat 发行版的等效 yum 包),必须首先安装操作系统依赖项:

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

Then you can install the following R packages, in the specified order:然后你可以按照指定的顺序安装以下 R 包:

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

Hope this helps希望这可以帮助

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

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