繁体   English   中英

无法在python中启动h2o-但在R中有效-连接被拒绝

[英]Unable to launch h2o in python - but it works in R - connection refused

我正在尝试在Python中启动h2o。 我可以在R中使用它,所以我不确定为什么它不能在Python中使用。 以下是我从Python收到的错误消息。

#R
library(h2o)
h2o.init()
 everything goes great

#Python
import h2o
h2o.init()

error below






Checking whether there is an H2O instance running at http://localhost:54321..... not found.
Attempting to start a local H2O server...
  Java Version: java version "10.0.1" 2018-04-17; Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10); Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
  Starting server from /anaconda3/lib/python3.6/site-packages/h2o/backend/bin/h2o.jar
  Ice root: /var/folders/lj/gf5ntj5j2lq9tqwjx5yhxtw8000ym1/T/tmpawb7odqt



H2OConnectionError                        Traceback (most recent call last)
/anaconda3/lib/python3.6/site-packages/h2o/h2o.py in init(url, ip, port, https, insecure, username, password, cookies, proxy, start_h2o, nthreads, ice_root, enable_assertions, max_mem_size, min_mem_size, strict_version_check, ignore_config, extra_classpath, **kwargs)
    251                                      _msgs=("Checking whether there is an H2O instance running at {url}",
--> 252                                             "connected.", "not found."))
    253     except H2OConnectionError:

/anaconda3/lib/python3.6/site-packages/h2o/backend/connection.py in open(server, url, ip, port, https, auth, verify_ssl_certificates, proxy, cookies, verbose, _msgs)
    317             conn._timeout = 3.0
--> 318             conn._cluster = conn._test_connection(retries, messages=_msgs)
    319             # If a server is unable to respond within 1s, it should be considered a bug. However we disable this

/anaconda3/lib/python3.6/site-packages/h2o/backend/connection.py in _test_connection(self, max_retries, messages)
    587             raise H2OConnectionError("Could not establish link to the H2O cloud %s after %d retries\n%s"
--> 588                                      % (self._base_url, max_retries, "\n".join(errors)))
    589 

H2OConnectionError: Could not establish link to the H2O cloud http://localhost:54321 after 5 retries
[18:49.71] H2OConnectionError: Unexpected HTTP error: HTTPConnectionPool(host='localhost', port=54321): Max retries exceeded with url: /3/Cloud (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1189ba048>: Failed to establish a new connection: [Errno 61] Connection refused',))
[18:49.93] H2OConnectionError: Unexpected HTTP error: HTTPConnectionPool(host='localhost', port=54321): Max retries exceeded with url: /3/Cloud (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1208284e0>: Failed to establish a new connection: [Errno 61] Connection refused',))
[18:50.13] H2OConnectionError: Unexpected HTTP error: HTTPConnectionPool(host='localhost', port=54321): Max retries exceeded with url: /3/Cloud (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x120835da0>: Failed to establish a new connection: [Errno 61] Connection refused',))
[18:50.35] H2OConnectionError: Unexpected HTTP error: HTTPConnectionPool(host='localhost', port=54321): Max retries exceeded with url: /3/Cloud (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x120835240>: Failed to establish a new connection: [Errno 61] Connection refused',))
[18:50.56] H2OConnectionError: Unexpected HTTP error: HTTPConnectionPool(host='localhost', port=54321): Max retries exceeded with url: /3/Cloud (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x11fc01080>: Failed to establish a new connection: [Errno 61] Connection refused',))

During handling of the above exception, another exception occurred:

H2OServerError                            Traceback (most recent call last)
<ipython-input-198-95453bf1556d> in <module>()
----> 1 h2o.init()

/anaconda3/lib/python3.6/site-packages/h2o/h2o.py in init(url, ip, port, https, insecure, username, password, cookies, proxy, start_h2o, nthreads, ice_root, enable_assertions, max_mem_size, min_mem_size, strict_version_check, ignore_config, extra_classpath, **kwargs)
    259             raise H2OConnectionError('Can only start H2O launcher if IP address is localhost.')
    260         hs = H2OLocalServer.start(nthreads=nthreads, enable_assertions=enable_assertions, max_mem_size=mmax,
--> 261                                   min_mem_size=mmin, ice_root=ice_root, port=port, extra_classpath=extra_classpath)
    262         h2oconn = H2OConnection.open(server=hs, https=https, verify_ssl_certificates=not insecure,
    263                                      auth=auth, proxy=proxy,cookies=cookies, verbose=True)

/anaconda3/lib/python3.6/site-packages/h2o/backend/server.py in start(jar_path, nthreads, enable_assertions, max_mem_size, min_mem_size, ice_root, port, extra_classpath, verbose)
    119         if verbose: print("Attempting to start a local H2O server...")
    120         hs._launch_server(port=port, baseport=baseport, nthreads=int(nthreads), ea=enable_assertions,
--> 121                           mmax=max_mem_size, mmin=min_mem_size)
    122         if verbose: print("  Server is running at %s://%s:%d" % (hs.scheme, hs.ip, hs.port))
    123         atexit.register(lambda: hs.shutdown())

/anaconda3/lib/python3.6/site-packages/h2o/backend/server.py in _launch_server(self, port, baseport, mmax, mmin, ea, nthreads)
    306         while True:
    307             if proc.poll() is not None:
--> 308                 raise H2OServerError("Server process terminated with error code %d" % proc.returncode)
    309             ret = self._get_server_info_from_logs()
    310             if ret:

H2OServerError: Server process terminated with error code 1

谁能给我一些具体的解决方法? 我正在使用Python的最新稳定版本。

确保您具有所有依赖项:

pip安装请求以表格形式显示“ colorama> = 0.3.8”

并从此处安装H2O:

pip安装-f http://h2o-release.s3.amazonaws.com/h2o/latest_stable_Py.html h2o

它对我没有任何错误。

更改Java版本。 使用Java 8。

暂无
暂无

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

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