简体   繁体   中英

import h2o fails on anaconda cmd but works on windows cmd ?

I have successfully installed h2o package using pip. But I am having a weird problem when I try to import it using windows cmd it works well but it fails when I try to do it through anaconda prompt command , jyputer or Spyder ? I tried to restart them and run the command but still having the same problem.

See this screenshoot below : 在此处输入图片说明

The problem that you are encountering is due to having multiple python versions on your machine, which is clearly visible in the screenshot. The default python version is not Anaconda python. After installing H2O using pip, it's not visible to python version installed via Anaconda distribution. There are a few options to solve this issue

  1. Install H2O using anaconda pip (from anaconda terminal)
  2. Install H2O using conda installer conda install -c anaconda h2o , which will install H2O version 3.18 from Anaconda channel
  3. Install directly from a channel maintained by H2O - conda install -c h2oai h2o , which is the up to date version of the library.

In addition, I would recommend correctly setting up environment variables and python path. Otherwise, it will become difficult to manage all of the packages and keep track which pip was used to install which package. Please see the following link for a discussion on how to add anaconda python to PYTHONPATH on a windows machine

https://docs.python.org/3/using/windows.html#excursus-setting-environment-variables

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM