Me gustaría lograr el mismo resultado que from module import * usando importlib.
Esta pregunta Importar módulo con un nombre local usando importlib describe cómo import module as mod , que está relacionado pero no es lo mismo.
Para emular from X import * debe importar el módulo y luego fusionar los nombres apropiados en el espacio de nombres global.
# get a handle on the module mdl = importlib.import_module('X') # is there an __all__? if so respect it if "__all__" in mdl.__dict__: names = mdl.__dict__["__all__"] else: # otherwise we import all names that don't begin with _ names = [x for x in mdl.__dict__ if not x.startswith("_")] # now drag them in globals().update({k: getattr(mdl, k) for k in names})