#!/usr/local/bin/python3 from importlib.machinery import PathFinder import importlib.util import os spec = PathFinder.find_spec('os') module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module)