H2OConnectionError: Not connected to a cluster

hi guys recently i've encounter this problem in google colab, and i dont know how to solve this problem

import h2o
h2o.init

data_train = "https://drive.google.com/open?id=14OYzA93IkuKPlkdvXs9Od53HyopgSQ2u"
data_train_df = h2o.import_file(path=data_train)

i following a book that suggest these following codes, but somehow it wont work.

Upvotes: 0

Views: 878

Answers (1)

mtanco
mtanco

Reputation: 76

The h2o package is not automatically installed in Google Colab. If you attempt to run import h2o without installing it, you will get the following error.

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-accdebc0c7de> in <module>()
----> 1 import h2o

ModuleNotFoundError: No module named 'h2o'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

Based on the error message you can then start a new code block and run !pip install h2o to install the package. Then, running import h2o should be successful.

One more thing to keep in mind is that you need to include parentheses to call a function. Running h2o.init will return the description <function h2o.h2o.init>. Try h2o.init() to initialize an h2o cluster.

Edit: The “not connected to a cluster” means you have not initialized a cluster. Try the h2o.init() command again, but using parenthesis so that the function is called and not printed.

Upvotes: 1

Related Questions