0

我已经在 Pycharm IDE 中安装了官方的 h2o 包,如下图所示,安装后当我使用 h2o.init() 初始化 h2o 时,h2o 会话立即开始和关闭。请说明为什么它会立即关闭。

在此处输入图像描述

import h2o
h2o.init(ip="localhost", port=54323)


:\Users\sarvendra.singh\PycharmProjects\H2o\venv\Scripts\python.exe C:/Users/sarvendra.singh/PycharmProjects/H2o/main.py
Checking whether there is an H2O instance running at http://localhost:54323 ..... not found.
Attempting to start a local H2O server...
; Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)
  Starting server from C:\Users\sarvendra.singh\PycharmProjects\H2o\venv\lib\site-packages\h2o\backend\bin\h2o.jar
  Ice root: c:\users\sarven~1.sin\appdata\local\temp\tmpmhrvqf
  JVM stdout: c:\users\sarven~1.sin\appdata\local\temp\tmpmhrvqf\h2o_sarvendra_singh_started_from_python.out
  JVM stderr: c:\users\sarven~1.sin\appdata\local\temp\tmpmhrvqf\h2o_sarvendra_singh_started_from_python.err
  Server is running at http://127.0.0.1:54323
Connecting to H2O server at http://127.0.0.1:54323 ... successful.
Warning: Your H2O cluster version is too old (8 months and 19 days)! Please download and install the latest version from http://h2o.ai/download/
--------------------------  ---------------------------------------------------------
H2O_cluster_uptime:         03 secs
H2O_cluster_timezone:       Asia/Kolkata
H2O_data_parsing_timezone:  UTC
H2O_cluster_version:        3.30.0.1
H2O_cluster_version_age:    8 months and 19 days !!!
H2O_cluster_name:           H2O_from_python_sarvendra_singh_y4j13p
H2O_cluster_total_nodes:    1
H2O_cluster_free_memory:    3.535 Gb
H2O_cluster_total_cores:    4
H2O_cluster_allowed_cores:  4
H2O_cluster_status:         accepting new members, healthy
H2O_connection_url:         http://127.0.0.1:54323
H2O_connection_proxy:       {"http": null, "https": null}
H2O_internal_security:      False
H2O_API_Extensions:         Amazon S3, Algos, AutoML, Core V3, TargetEncoder, Core V4
Python_version:             2.7.18 final
--------------------------  ---------------------------------------------------------
Closing connection _sid_973f at exit
H2O session _sid_973f closed.

Process finished with exit code 0
4

1 回答 1

1

您似乎正在使用 PyCharm 来运行您的代码。如果您更喜欢交互式会话,我建议您使用“Python 控制台”来输入您的命令。这将保持会话打开,以便您可以从浏览器访问 Flow GUI,同时保持将 Python 数据帧注入 Java 服务器的能力。

顺便说一句,我发现使用 Flow 导入 csv 文件很困难,但 Python 数据帧可用于将数据传送到流程中而不会出错。

于 2020-12-31T14:34:31.403 回答