嘿,我使用的是anaconda环境,并且已经成功安装了h20py库等等。只是当我尝试运行h2o.init((时,它会给我以下错误
H2OConnectionError Traceback (most recent call last)
~/opt/anaconda3/envs/py36/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:
~/opt/anaconda3/envs/py36/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
~/opt/anaconda3/envs/py36/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 retriesn%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
[06:14.50] H2OConnectionError: Unexpected HTTP error: HTTPConnectionPool(host='localhost', port=54321): Max retries exceeded with url: /3/Cloud (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd0f913b390>: Failed to establish a new connection: [Errno 61] Connection refused',))
[06:14.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 0x7fd0f913ba58>: Failed to establish a new connection: [Errno 61] Connection refused',))
[06:14.92] H2OConnectionError: Unexpected HTTP error: HTTPConnectionPool(host='localhost', port=54321): Max retries exceeded with url: /3/Cloud (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd1186fd160>: Failed to establish a new connection: [Errno 61] Connection refused',))
[06:15.14] H2OConnectionError: Unexpected HTTP error: HTTPConnectionPool(host='localhost', port=54321): Max retries exceeded with url: /3/Cloud (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd1186fd828>: Failed to establish a new connection: [Errno 61] Connection refused',))
[06:15.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 0x7fd1186fdef0>: Failed to establish a new connection: [Errno 61] Connection refused',))
During handling of the above exception, another exception occurred:
H2OStartupError Traceback (most recent call last)
<ipython-input-3-95453bf1556d> in <module>
----> 1 h2o.init()
~/opt/anaconda3/envs/py36/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)
~/opt/anaconda3/envs/py36/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)
110 hs = H2OLocalServer()
111 hs._verbose = bool(verbose)
--> 112 hs._jar_path = hs._find_jar(jar_path)
113 hs._extra_classpath = extra_classpath
114 hs._ice_root = ice_root
~/opt/anaconda3/envs/py36/lib/python3.6/site-packages/h2o/backend/server.py in _find_jar(self, path0)
204 return jp
205 raise H2OStartupError("Cannot start local server: h2o.jar not found. Paths searched:n" +
--> 206 "".join(" %sn" % s for s in searched_paths))
207
208 @staticmethod
H2OStartupError: Cannot start local server: h2o.jar not found. Paths searched:
/Users/sharozearcher/opt/anaconda3/envs/py36/lib/python3.6/site-packages/h2o/backend/bin/h2o.jar
/Users/sharozearcher/opt/anaconda3/envs/py36/h2o_jar/h2o.jar
/usr/local/h2o_jar/h2o.jar
/Users/sharozearcher/opt/anaconda3/envs/py36/local/h2o_jar/h2o.jar
/Users/sharozearcher/.local/h2o_jar/h2o.jar
/Users/sharozearcher/opt/anaconda3/envs/py36/h2o_jar/h2o.jar
如有任何帮助,我们将不胜感激。
附言:我正在使用Jupyter笔记本
我在新环境中尝试了conda install -c h2oai h2o
,一切都很好。
你似乎只安装了这个包的客户端版本,其中不包括h2o.jar。你能提供你的命令来复制它吗?