无法使用h2o.init()连接到R中的h20

时间:2017-02-03 06:35:47

标签: r rstudio

我正尝试使用以下命令首次在R Studio中连接到h20:

library(h2o)
h2o.init()

R版本2.3.2和h20版本3.10.2.2。关于如何解决这个问题的任何想法,我可以连接?

H2O is not running yet, starting it now...
running command ''/usr/bin/java' -version 2>&1' had status 1
Note:  In case of errors look at the following log files:
    /var/folders/w7/vpssy9010lg4xxlwkg5f2zwm0000gn/T//RtmpZhyGXB/h2o_chrisstroud_started_from_r.out
    /var/folders/w7/vpssy9010lg4xxlwkg5f2zwm0000gn/T//RtmpZhyGXB/h2o_chrisstroud_started_from_r.err

No Java runtime present, requesting install.

Starting H2O JVM and connecting: ............................................................ 
[1] "localhost"
[1] 54321
[1] TRUE
[1] -1
[1] "Failed to connect to localhost port 54321: Connection refused"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed to connect to localhost port 54321: Connection refused
[1] 7
 Show Traceback
Error in h2o.init() : H2O failed to start, stopping execution.

1 个答案:

答案 0 :(得分:3)

如果启用了代理,它将无法正常工作。

Sys.setenv(https_proxy="") 
Sys.setenv(http_proxy="") 
Sys.setenv(http_proxy_user="") 
Sys.setenv(https_proxy_user="")

为我修复了该问题。