python cannot import name from module code example

Example 1: importerror: cannot import name

# While you should definitely avoid circular dependencies,
# you can defer imports in python.
# for example:

import SomeModule

def someFunction(arg):
    from some.dependency import DependentClass
    
#this ( at least in some instances ) will circumvent the error.

Example 2: importerror: cannot import name

You have circular dependent imports. physics.py is imported from entity before class Ent is defined and physics tries to import entity that is already initializing. Remove the dependency to physics from entity module.