#!/usr/local/bin/python3 from importlib.machinery import PathFinder import os spec = PathFinder.find_spec('os', '/usr/local/lib/python3.6/') print(spec)