

def __init__(self, import_name, exception):
    self.import_name = import_name
    self.exception = exception
    msg = 'import_string() failed for %r. Possible reasons are:\n\n- missing __init__.py in a package;\n- package or module path not included in sys.path;\n- duplicated package or module name taking precedence in sys.path;\n- missing module, class, function or variable;\n\nDebugged import:\n\n%s\n\nOriginal exception:\n\n%s: %s'
    name = ''
    tracked = []
    for part in import_name.replace(':', '.').split('.'):
        name += ((name and '.') + part)
        imported = import_string(name, silent=True)
        if imported:
            tracked.append((name, getattr(imported, '__file__', None)))
        else:
            track = [('- %r found in %r.' % (n, i)) for (n, i) in tracked]
            track.append(('- %r not found.' % name))
            msg = (msg % (import_name, '\n'.join(track), exception.__class__.__name__, str(exception)))
            break
    ImportError.__init__(self, msg)

dataset/ETHPy150Open tony/tmuxp/tmuxp/testsuite/__init__.py ImportStringError.__init__/original