Python cannot find package h2o in anaconda

…衆ロ難τιáo~ 提交于 2020-06-25 00:41:08

问题


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>

回答1:


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.




回答2:


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

pip install h2o



回答3:


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.




回答4:


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>



回答5:


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



来源:https://stackoverflow.com/questions/44577923/python-cannot-find-package-h2o-in-anaconda

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!