Package Discovery and Resource Access using pkg_resources ...
setuptools.pypa.io › en › latestThe pkg_resources module provides runtime facilities for finding, introspecting, activating and using installed Python distributions. Some of the more advanced features (notably the support for parallel installation of multiple versions) rely specifically on the “egg” format (either as a zip archive or subdirectory), while others (such as plugin discovery) will work correctly so long as “egg-info” metadata directories are available for relevant distributions.
PEP 365 -- Adding the pkg_resources module | Python.org
www.python.org › dev › pepspkg_resources is a module used to find and manage Python package/version dependencies and access bundled files and resources, including those inside of zipped .egg files. Currently, pkg_resources is only available through installing the entire setuptools distribution, but it does not depend on any other part of setuptools; in effect, it comprises the entire runtime support library for Python Eggs, and is independently useful.
Python Examples of pkg_resources.require
www.programcreek.com › python › examplerep_modules = 'pkg_resources', 'setuptools' imported = set(sys.modules).intersection(rep_modules) try: import pkg_resources pkg_resources.require("setuptools>=" + version) # a suitable version is already installed return except ImportError: # pkg_resources not available; setuptools is not installed; download pass except pkg_resources.DistributionNotFound: # no version of setuptools was found; allow download pass except pkg_resources.VersionConflict as VC_err: if imported: _conflict_bail(VC ...