I thought I might try: import pkg_resources; except: import pip.vendor.pkg_resources at some point.