getPythonPackages¶
- lsst.utils.packages.getPythonPackages() dict[str, str] ¶
Get imported python packages and their versions.
Notes
We wade through
sys.modules
and 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
python
key 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
yaml
will appear as the version key even though the distribution would be calledPyYAML
.