在Amazon Linux EC2实例上安装R软件包

时间:2023-01-26 12:37:10

I am learning to use RSelenium in an EC2 instance, and I found this handy guide on doing so - https://rpubs.com/grahamplace/rselenium-ec2 - however the guide focuses on an Ubuntu instance and I am using an Amazon Linux Instance. In order to install RSelenium, the guide says I must externally (outside of R but ssh'd into my EC2 instance) install the packages xml (XML i think, case sensitive) and RCurl. The guide's relevant lines of code are:

我正在学习在EC2实例中使用RSelenium,我找到了这个方便的指南 - https://rpubs.com/grahamplace/rselenium-ec2 - 但是指南主要关注Ubuntu实例并且我使用的是Amazon Linux实例。为了安装RSelenium,指南说我必须在外部(在R之外但是ssh'd进入我的EC2实例)安装包xml(我认为是XML,区分大小写)和RCurl。该指南的相关代码行是:

sudo apt-get install r-cran-xml
sudo apt-get install r-cran-RCurl

however, since I'm in an Amazon Linux instance, I tried:

但是,因为我在亚马逊Linux实例中,我试过:

sudo yum install r-cran-xml
sudo yum install r-cran-RCurl

for which I get the following error:

我得到以下错误:

No package r-cran-RCurl available.
Error: Nothing to do

Note: I was successful in installing R on my machine (my instance), and I am able to simply type R to launch R in the EC2 instance.

注意:我在我的机器(我的实例)上成功安装了R,并且我能够简单地键入R以在EC2实例中启动R.

Note2: install.packages('XML') and install.packages('RCurl') with R launched do not work either.

注意2:启动了R的install.packages('XML')和install.packages('RCurl')也不起作用。

Any help appreciated with this, thanks!

感谢任何帮助,谢谢!

1 个解决方案

#1


2  

the amazon linux R package has a different name:

amazon linux R包有一个不同的名字:

sudo yum install -y R

from there, it seems you tried (in R) library(XML) and library(RCurl), but they weren't included with the amazon linux R package, and install.packages(c('XML','RCurl')) also didn't work.

从那里,你似乎尝试(在R)库(XML)和库(RCurl),但它们不包含在amazon linux R包和install.packages(c('XML','RCurl'))也没用。

i could say more if you had included the error message that occurred when you tried install.packages, but most likely you need to install some additional amazon linux packages, e.g., gcc, gfortran. yum search may be a useful command as well.

如果您包含了尝试install.packages时出现的错误消息,我可以说更多,但很可能您需要安装一些额外的amazon linux软件包,例如gcc,gfortran。 yum搜索也可能是一个有用的命令。

#1


2  

the amazon linux R package has a different name:

amazon linux R包有一个不同的名字:

sudo yum install -y R

from there, it seems you tried (in R) library(XML) and library(RCurl), but they weren't included with the amazon linux R package, and install.packages(c('XML','RCurl')) also didn't work.

从那里,你似乎尝试(在R)库(XML)和库(RCurl),但它们不包含在amazon linux R包和install.packages(c('XML','RCurl'))也没用。

i could say more if you had included the error message that occurred when you tried install.packages, but most likely you need to install some additional amazon linux packages, e.g., gcc, gfortran. yum search may be a useful command as well.

如果您包含了尝试install.packages时出现的错误消息,我可以说更多,但很可能您需要安装一些额外的amazon linux软件包,例如gcc,gfortran。 yum搜索也可能是一个有用的命令。