'Error Installing H2O in Python - AttributeError: partially initialized module 'h2o' has no attribute 'init' (most likely due to a circular import)

I followed the steps given by the site (https://docs.h2o.ai/h2o/latest-stable/h2o-docs/downloading.html) and install the following:

pip install requests
pip install tabulate
pip install future
pip uninstall h2o
pip install -f http://h2o-release.s3.amazonaws.com/h2o/latest_stable_Py.html h2o

And the terminal return that "Successfully installed h2o-3.36.1.1".

However, when I run the code to optionally initialize H2O in Python and run a demo to see H2O at work, using this script:

import h2o
h2o.init()
h2o.demo("glm")

it returns this error:

Traceback (most recent call last):
  File "C:\Users\Mary\Desktop\Algorithms\Algorithms\h2o.py", line 1, in <module>
    import h2o
  File "C:\Users\Mary\Desktop\Algorithms\h2o.py", line 2, in <module>
    h2o.init()
AttributeError: partially initialized module 'h2o' has no attribute 'init' (most likely due to a circular import)

Could someone tell me why I can't run h2o? Thank you in advance.



Solution 1:[1]

Try to change the name of the module you have created. There's a conflict.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1