diff --git a/monai/utils/module.py b/monai/utils/module.py index bbd8bdd0bf..eb14823aba 100644 --- a/monai/utils/module.py +++ b/monai/utils/module.py @@ -564,7 +564,7 @@ def version_leq(lhs: str, rhs: str) -> bool: """ lhs, rhs = str(lhs), str(rhs) - pkging, has_ver = optional_import("packaging.Version") + pkging, has_ver = optional_import("packaging") if has_ver: try: return cast(bool, pkging.version.Version(lhs) <= pkging.version.Version(rhs)) @@ -591,7 +591,7 @@ def version_geq(lhs: str, rhs: str) -> bool: """ lhs, rhs = str(lhs), str(rhs) - pkging, has_ver = optional_import("packaging.Version") + pkging, has_ver = optional_import("packaging") if has_ver: try: return cast(bool, pkging.version.Version(lhs) >= pkging.version.Version(rhs))