在 Pycharm IDE 中的 h2o.init 上立即初始化和关闭 h2o 会话

问题描述

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

enter image description here

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

解决方法

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

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

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...