You can do that using __import__()
. For example:
foobar = __import__("foo-bar")
But you really should rename the module instead. That way you can avoid confusion where the filename of the module is different from the identifier used in the program.