0

I am attempting to install the h2o4gpu Python module as per the instructions listed here: https://github.com/h2oai/h2o4gpu/issues/464

pip says that it successfully installed all packages, including h2o4gpu-0.1.0.

However I then still get

    import h2o4gpu
ImportError: No module named h2o4gpu

and

kevin@Ubuntu-XPS:~/Downloads$ pip show tensorflow-gpu
Name: tensorflow-gpu
Version: 1.9.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: grpcio, mock, protobuf, enum34, gast, wheel, absl-py, backports.weakref, termcolor, six, numpy, tensorboard, setuptools, astor
kevin@Ubuntu-XPS:~/Downloads$ pip show h2o4gpu
kevin@Ubuntu-XPS:~/Downloads$ 

thus showing that pip acknowledges that tensorflow-gpu is installed, but not h2o4gpu.

I am running Ubuntu 18.04 - could the cause of this be that h2o4gpu isn't yet supported on version 18? import h2o works fine.

KOB
  • 4,084
  • 9
  • 44
  • 88
  • Did you use the `pip3 install h2o4gpu-0.1.0-py36-none-any.whl` from the instructions you have linked? – FlyingTeller Jul 23 '18 at 12:19
  • Yes I did. If I try to use just `pip` I get `h2o4gpu-0.1.0-py36-none-any.whl is not a supported wheel on this platform.` – KOB Jul 23 '18 at 12:21
  • Now that you pointed that out, `pip3 show h2o4gpu` does return all of its details. What does this mean? Is my program with `import h2o4gpu` attempting to run it using python2 or something? – KOB Jul 23 '18 at 12:23
  • You isntalled h204gpu for python3 but try to import it in python2 which doesn't work – FlyingTeller Jul 23 '18 at 12:23
  • I see, thank you. I am running the program within Atom using the 'script' plugin - it seems to automatically use python2 when it can. Running it manually with python3 from the command line works. – KOB Jul 23 '18 at 12:26
  • For Atom, see [this discussion](https://discuss.atom.io/t/how-can-i-switch-python-version-for-script/24036/4) – FlyingTeller Jul 23 '18 at 12:36

2 Answers2

1

You are mixing python2 and python3. What you are using when running pip or python are all python2.7 (see also the output of pip show tensorflow where it is referring to /usr/local/lib/python2.7/dist-packages).

The library you are trying to use only has .whl for python 3.6 (note the py36 in the .whl files name)

Therefore, you need to either:

  • Switch to using pip3 and python3
  • Find another library that works with python 2.7
FlyingTeller
  • 17,638
  • 3
  • 38
  • 53
0

We are not shipping python 2.7 wheels for H2O4GPU, so you will need to use pip3 as suggested by FlyingTeller.

It would be best to use virtualenv to create a python environment to cause minimal changes to system python.

sudo apt-get install python3-pip
sudo pip3 install virtualenv
virtualenv -p python36 h2o4gpuenv
. h2o4gpuenv/bin/activate
pip install h2o4gpu-*.whl

Now in this same virtual environment, start python and try import h2o4gpu.