bilby.core.utils.log.env_package_list

bilby.core.utils.log.env_package_list(as_dataframe=False)[source]

Get the list of packages installed in the system prefix.

If it is detected that the system prefix is part of a Conda environment, a call to conda list --prefix {sys.prefix} will be made, otherwise the call will be to {sys.executable} -m pip list installed.

Parameters:
as_dataframe: bool

return output as a pandas.DataFrame

Returns:
pkgslist of dict, or pandas.DataFrame

If as_dataframe=False is given, the output is a list of dict, one for each package, at least with 'name' and 'version' keys (more if conda is used). If as_dataframe=True is given, the output is a DataFrame created from the list of dicts.