本文介绍了ImportError:无法导入名称ModuleA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

当我尝试导入ModuleA时,我有以下stacktrace:

I have the following stacktrace when I try to import ModuleA:

    Traceback (most recent call last):
  File "menu.py", line 9, in <module>
    from tmserver import Module1
  File "~/tmserver/Module1.py", line 10, in <module>
    from tmserver.PackageA import ModuleA
  File "~/tmserver/Package1/ModuleA.py", line 8, in <module>
    from tmserver.Package2 import Module2
  File "~/tmserver/Package2/Module2.py", line 15, in <module>
    from tmserver.Package3 import Module3
  File "~/tmserver/Package3/Module3.py", line 5, in <module>
    from tmserver.PackageA import ModuleA
ImportError: cannot import name ModuleA

是这是因为它再次/递归地导入ModuleA?

Is this because it's importing ModuleA again/recursively?

推荐答案

这似乎是合乎逻辑的结论;也许如果您发布了正在运行的代码示例,您可以得到更好的回复?

That would seem like the logical conclusion; perhaps if you posted samples of the code you were running you'd be able to get a better reply?

这篇关于ImportError:无法导入名称ModuleA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 11:08