ImportError: Cannot import name X

前端 未结 16 1491
隐瞒了意图╮
隐瞒了意图╮ 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:14

    Don't name your current python script with the name of some other module you import

    Solution: rename your working python script

    Example:

    1. you are working in medicaltorch.py
    2. in that script, you have: from medicaltorch import datasets as mt_datasets where medicaltorch is supposed to be an installed module

    This will fail with the ImportError. Just rename your working python script in 1.

提交回复
热议问题