I have a string that contains the text of a Python module. I want to import this as a Python module bound to a local name.
I can import it globally in a way such as the following:
exec myModuleString in globals()
What I want to do is import it bound to a local name, much as in the following way:
import numpy as np
How could I do this?