开发者

ImportError: cannot import name ModuleA

开发者 https://www.devze.com 2023-02-05 11:40 出处:网络
I have the following stacktrace when I try to import ModuleA: Traceback (most recent call last): File \"menu.py\", line 9, in <module>

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                                               
  Fil开发者_JS百科e "~/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

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消