gpt4 book ai didi

python - 在 Python 中初始化 H2O

转载 作者:行者123 更新时间:2023-11-30 09:21:47 28 4
gpt4 key购买 nike

当尝试通过运行以下行在 Python 中初始化 H2O 时:

import h2o
h2o.init()

我得到了异常(exception):


Traceback (most recent call last):
File "C:/workspace/DataScience/univariate_analysis/prudential_RF.py", line 4, in
h2o.init()
File "C:\Anaconda\lib\site-packages\h2o\h2o.py", line 668, in init
H2OConnection(ip=ip, port=port,start_h2o=start_h2o,enable_assertions=enable_assertions,license=license,max_mem_size_GB=max_mem_size_GB,min_mem_size_GB=min_mem_size_GB,ice_root=ice_root,strict_version_check=strict_version_check)
File "C:\Anaconda\lib\site-packages\h2o\connection.py", line 101, in __init__
raise EnvironmentError, message
EnvironmentError: Version mismatch. H2O is version 3.2.0.9, but the python package is version 3.6.0.8.
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "C:\Anaconda\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "C:\Anaconda\lib\site-packages\h2o\connection.py", line 565, in end_session
H2OConnection.delete(url_suffix="InitID")
File "C:\Anaconda\lib\site-packages\h2o\connection.py", line 393, in delete
return __H2OCONN__._do_raw_rest(url_suffix, "DELETE", None, **kwargs)
File "C:\Anaconda\lib\site-packages\h2o\connection.py", line 483, in _do_raw_rest
.format(http_result.status_code,http_result.reason,method,url,detailed_error_msgs))
EnvironmentError: h2o-py got an unexpected HTTP status code:
404 Not Found (method = DELETE; url = http://localhost:54321/3/InitID).
detailed error messages: DELETE /3/InitID not found
Error in sys.exitfunc:
Traceback (most recent call last):
File "C:\Anaconda\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "C:\Anaconda\lib\site-packages\h2o\connection.py", line 565, in end_session
H2OConnection.delete(url_suffix="InitID")
File "C:\Anaconda\lib\site-packages\h2o\connection.py", line 393, in delete
return __H2OCONN__._do_raw_rest(url_suffix, "DELETE", None, **kwargs)
File "C:\Anaconda\lib\site-packages\h2o\connection.py", line 483, in _do_raw_rest
.format(http_result.status_code,http_result.reason,method,url,detailed_error_msgs))
EnvironmentError: h2o-py got an unexpected HTTP status code:
404 Not Found (method = DELETE; url = http://localhost:54321/3/InitID).
detailed error messages: DELETE /3/InitID not found

请注意,我已按照此链接 Use H2O directly from Python 中的安装步骤进行操作。

最佳答案

您的 h2o python 代码和 h2o java 代码版本不匹配。

如果您download a fresh version of h2o ,确保您还使用相同的版本号进行 pip 安装。 不要使用通用的 pip 安装...而是明确指定 URL 和版本。

Download the java package并启动java jar: enter image description here

然后还可以单击安装 python 链接来获取相应的 pip install 命令:

enter image description here

请注意,此行需要与您刚刚安装的 java 版本号匹配:

pip install http://h2o-release.s3.amazonaws.com/h2o/reltibshirani/8/Python/h2o-3.6.0.8-py2.py3-none-any.whl

然后再试一次:

import h2o
h2o.init()

希望这有帮助!

关于python - 在 Python 中初始化 H2O,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33997271/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com