ImportError:无法从部分初始化的模块“ binarytree”中导入名称“ build”

时间:2020-06-28 11:14:04

标签: python-3.x binary-tree

我的猜测是,这很可能是由于循环导入引起的。

from binarytree import build
n = build([4,5,3,7,8,2,1])

print(n)

错误:-

Traceback (most recent call last):
  File "d:\ml and ai in python\binarytree.py", line 1, in <module>
    from binarytree import build
  File "d:\ml and ai in python\binarytree.py", line 1, in <module>
    from binarytree import build
ImportError: cannot import name 'build' from partially initialized module 'binarytree' (most likely due to a circular import) (d:\ml and ai in python\binarytree.py)

0 个答案:

没有答案