Rene Pijlman <reply.in.the.newsgroup at my.address.is.invalid> writes: > How do I do: > > from spam import eggs > > ... when 'spam' is only known at runtime? Why not just stick the import statement where you need it? def do_something_that_needs_spam_module(): import spam ... John