简体   繁体   English

如何在 Anaconda R-essentials 中安装 H2O?

[英]How to install H2O in Anaconda R-essentials?

I am using Jupyter notebooks with R ie by using R-essentials in Anaconda.我通过在 Anaconda 中使用 R-essentials 将 Jupyter 笔记本与 R ie 一起使用。 However, while installing H2O package in Jupyter notebook using但是,在使用 Jupyter notebook 安装 H2O 包时

install.packages("h2o") install.packages("h2o")

it is giving an error and unable to install it.它给出了错误并且无法安装它。 I also tried我也试过

conda install c -r anaconda h20 conda install c -r anaconda h20

in terminal and it did installed h2o.在终端中,它确实安装了 h2o。 But while exceuting the library function in the r notebook:但是在 r notebook 中执行库函数时:

library(h2o)图书馆(水)

I am getting the following error message:我收到以下错误消息:

Error in library(h2o): there is no package called ‘h2o’
Traceback:

1. library(h2o)
2. stop(txt, domain = NA)

Please let me know how to resolve this.请让我知道如何解决这个问题。

If you want to install h2o from within R please follow the download instructions here (this link will provide you with the latest stable version).如果您想从 R 中安装 h2o,请按照此处的下载说明进行操作(此链接将为您提供最新的稳定版本)。 for your convenience I am also pasting what is currently listed under the R tab (below):为方便起见,我还将粘贴当前在 R 选项卡下列出的内容(如下):

Please also note that it looks like you ran h20 instead of h2o (like water) in conda install c -r anaconda h20 and in addition looking at the anaconda docs if you want to install an r package you need to pre-fix the package with an r- , and lastly if you want to install h2o from anaconda you should use the h2oai channel not the default anaconda channel.另请注意,看起来您在conda install c -r anaconda h20中运行h20而不是h2o (如水),此外,如果您想安装 r 软件包,请查看anaconda 文档,您需要预先修复该软件包一个r- ,最后如果你想从 anaconda 安装 h2o,你应该使用h2oai频道而不是默认的 anaconda 频道。 That being said if you do a search for the r-h2o package you will see if is not available for download in this manner conda search -f r-h2o so your best option is to install through R via the instructions pasted below.话虽如此,如果您搜索r-h2o软件包,您将看到是否无法以这种方式下载conda search -f r-h2o所以您最好的选择是通过下面粘贴的说明通过 R 安装。

Copy and paste these commands into R one line at a time:

# The following two commands remove any previously installed H2O packages for R.
if ("package:h2o" %in% search()) { detach("package:h2o", unload=TRUE) }
if ("h2o" %in% rownames(installed.packages())) { remove.packages("h2o") }

# Next, we download packages that H2O depends on.
pkgs <- c("RCurl","jsonlite")
for (pkg in pkgs) {
if (! (pkg %in% rownames(installed.packages()))) { install.packages(pkg) }
}

# Now we download, install and initialize the H2O package for R.
install.packages("h2o", type="source", repos="http://h2o-release.s3.amazonaws.com/h2o/rel-xu/6/R")

# Finally, let's load H2O and start up an H2O cluster
library(h2o)
h2o.init()

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

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