ImportError: Cannot import name X

前端 未结 16 1211
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 04:33

I have four different files named: main, vector, entity and physics. I will not post all the code, just the imports, because I think that\'s where the error is. (If you want

16条回答
  •  死守一世寂寞
    2020-11-22 05:02

    One way to track import error is step by step trying to run python on each of imported files to track down bad one.

    1. you get something like:

      python ./main.py
      

      ImportError: cannot import name A

    2. then you launch:

      python ./modules/a.py
      

      ImportError: cannot import name B

    3. then you launch:

      python ./modules/b.py
      

      ImportError: cannot import name C (some NON-Existing module or some other error)

提交回复
热议问题