search_paths = [path_to_spam]
modfile, modpath, description = imp.find_module('spam', search_paths)
with modfile:
    pass
Restrict import to specific path, without restricting the imported module's path