我有一个名为test.py的文件,其中包含以下内容
import h2o
h2o.init()
但是当我通过命令行运行test.py时,我得到一个AttributeError
$ python test.py
Traceback (most recent call last):
File "test.py", line 1, in <module>
import h2o
File "c:\Users\username\AppData\Local\Programs\Python\Python35-32\lib\site-packa
ges\h2o\__init__.py", line 7, in <module>
from .h2o import *
File "c:\Users\username\AppData\Local\Programs\Python\Python35-32\lib\site-packa
ges\h2o\h2o.py", line 15, in <module>
from .expr import ExprNode
File "c:\Users\username\AppData\Local\Programs\Python\Python35-32\lib\site-packa
ges\h2o\expr.py", line 5, in <module>
from future.backports.urllib.request import quote
File "c:\Users\username\AppData\Local\Programs\Python\Python35-32\lib\site-packa
ges\future-0.15.2-py3.5.egg\future\backports\__init__.py", line 14, in <module>
import_top_level_modules()
File "c:\Users\username\AppData\Local\Programs\Python\Python35-32\lib\site-packa
ges\future-0.15.2-py3.5.egg\future\standard_library\__init__.py", line 806, in i
mport_top_level_modules
with exclude_local_folder_imports(*TOP_LEVEL_MODULES):
File "c:\Users\username\AppData\Local\Programs\Python\Python35-32\lib\site-packa
ges\future-0.15.2-py3.5.egg\future\standard_library\__init__.py", line 776, in _
_enter__
module = __import__(m, level=0)
File "c:\Users\username\Desktop\test.py", line 3, in <module>
h2o.init()
AttributeError: module 'h2o' has no attribute 'init'
代码在ILDE中运行良好。有什么建议吗?
**我有Python 3.5.1,我通过print(h2o)检查了我的h2o.py路径,它在ILDE和CMD中看起来是一样的