getPythonPackages¶
- lsst.utils.packages.getPythonPackages() dict[str, str]¶
Get imported python packages and their versions.
Notes
We wade through
sys.modulesand attempt to determine the version for each module. Note, therefore, that we can only report on modules that have already been imported.Python standard library packages are not included in the report. A
pythonkey is inserted that records the Python version.We don’t include any module for which we cannot determine a version.
Whilst distribution names are used to determine package versions, the key returned for the package version is the package name that was imported. This means that
yamlwill appear as the version key even though the distribution would be calledPyYAML.