minversion#
- astropy.utils.introspection.minversion(module, version, inclusive=True)[source]#
Returns
Trueif the specified Python module satisfies a minimum version requirement, andFalseif not.- Parameters:
- modulemodule or
str An imported module of which to check the version, or the name of that module.
Changed in version 8.1.0: No dynamic import is attempted if a module is passed by name. Instead, metadata is looked up from an installed package without executing it.
- version
str The version as a string that this module must have at a minimum (e.g.
'0.12').- inclusive
bool The specified version meets the requirement inclusively (i.e.
>=) as opposed to strictly greater than (default:True).
- modulemodule or
Examples
>>> import numpy >>> minversion(numpy, '1.21.0') True