11

When I try to import h2o I am told that the package does not exist. When I try to install it, it tells me it already exists. I have tried wiping it out of my computer and reinstalling to no avail. At this point all I can think is some environment variable.

(C:\Users\Lanier\Anaconda2) C:\Users\Lanier>python
Python 2.7.12 |Anaconda custom (64-bit)| (default, Jun 29 2016, 11:07:13) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import h2o
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named h2o
>>> quit()

(C:\Users\Lanier\Anaconda2) C:\Users\Lanier>conda install h2o
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at C:\Users\Lanier\Anaconda2:
#
h2o                       3.10.0.9                      0

(C:\Users\Lanier\Anaconda2) C:\Users\Lanier>
mlanier
  • 167
  • 2
  • 3
  • 14
  • Maybe you have two pythons installed? – leoxs Jun 15 '17 at 22:25
  • I do. But the Python there is 2.7, and i believe anaconda2 is 2.7. I'll check it when I'm home for sure. I have to activate my Python 3 environment to get Python 3. – mlanier Jun 15 '17 at 22:51
  • I had the same problem because anaconda installed a new Python – leoxs Jun 15 '17 at 22:54
  • When I do conda - conda list I see that every package has an env `license 1.1 py35_1 alabaster 0.7.10 py35_0 anaconda 4.4.0 np112py35_0 anaconda-client 1.6.3 py35_0 anaconda-navigator 1.6.2 py35_0` But when I get down to h2o its blank. Any ideas how to manually modify this? – mlanier Jun 16 '17 at 01:50

6 Answers6

14

conda packages arn't language specific, in this case conda install h2o installs the java package. You need to do conda install h2o-py

No idea why this worked on my old computer without the -py.

mlanier
  • 167
  • 2
  • 3
  • 14
  • 2
    I think this only works for Python 2.7 and not Python 3.6 – Alberto Artasanchez Jan 16 '18 at 15:51
  • 2
    Please note that `h2o-py` is not an official h2o.ai package and is not recommended. Use `conda install -c h2oai h2o` to get the official python package. Source: http://h2o-release.s3.amazonaws.com/h2o/latest_stable.html – Joe Aug 17 '19 at 22:56
5

For python 3.7, the h2o library is not supporting as on Feb-2019. So, I have created a new environment with 3.6 version and installed h2o using,

conda install -c h2oai h2o -n <myenvname>
Siddaram H
  • 1,126
  • 12
  • 17
4

I had the same problem with conda install, but everything worked fine with:

pip install h2o
Martin Evans
  • 45,791
  • 17
  • 81
  • 97
  • Yes it did work fine on my machine (Windows 10) , Anaconda3-5.0.1, h2o cluster version: 3.16.0.2 . But this did not work: conda install -c anaconda h2o . – Ashok K Harnal Dec 26 '17 at 06:37
4

If anyone still struggling with this issue, according to docs:

H2O has tabulate>=0.75 as a dependency; however, there is no tabulate available in the default channels for Python 3.6. This is available in the conda-forge channel. As a result, Python 3.6 users must add the conda-forge channel in order to load the latest version of H2O.

Thus, you have to follow the following steps:
conda config --append channels conda-forge
This, will append the conda-forge channel to your available repositories.
Then:
conda install -c h2oai h2o
to install the needed packages.

Yannis
  • 683
  • 7
  • 16
1

Suppose you are running on the Windows system, here is the way I resolved this issue:

  1. Open your Anaconda Prompt.

  2. Enter conda create -n py36 python=3.6 anaconda to create a channel with python 3.6.
    (which is often a neglected part, since up-to-date version is 3.83 while h2o module is only supported in 2.7,3.5,3.6)

  3. Enter activate py36 on the same screen to initiate a new channel named py36.

  4. Enter config --append channels conda-forge in order to load the latest version of h2o.

  5. Enter conda install -c h2oai h2o install the required modules including h20 and tabulate in the channel py36.

  6. Exit the anaconda prompt, click on the anaconda-navigator application icon or type anaconda-navigator in your anaconda prompt.

  7. Once you are on the main screen of anaconda-navigator, select py36 as the channel to run applications on the upper-left corner.
    (You may notice a bunch of random apps on your anaconda navigator, that's because conda forge is in your list of channels, you can either remove it by clicking on the delete button).

  8. Select any environment (Jupyter, Spyder, etc) on which you want to run your application, now you should be able to import h2o.

    Hope this answer helps you.

Newcomer
  • 73
  • 7
-1

Please use below command.. I was facing same issue.. but after executing below command issue got resolved.

python -m pip install h2o

OR if you are using python3 :

python3 -m pip install h2o