I am working on a project that requires to have several modules with the same name. This is a representative extract of the architecture, with __init__.py files
__init__.py
One way would be to use the imp module.
import imp somectrl = imp.load_source("somectrl", "path1/ProjectA/src/ctrl/somectrl.py") someclass = imp.load_source("someclass", "path2/ProjectA/src/someclass.py")