diff --git a/xarray/core/ops.py b/xarray/core/ops.py index a7367f7ebcf..20cc9cc3a96 100644 --- a/xarray/core/ops.py +++ b/xarray/core/ops.py @@ -6,7 +6,7 @@ import inspect import operator import warnings -from distutils.version import StrictVersion +from distutils.version import LooseVersion import numpy as np import pandas as pd @@ -525,7 +525,7 @@ def inject_bottleneck_rolling_methods(cls): # bottleneck rolling methods if has_bottleneck: - if StrictVersion(bn.__version__) < StrictVersion('1.0'): + if LooseVersion(bn.__version__) < LooseVersion('1.0'): return for bn_name, method_name in BOTTLENECK_ROLLING_METHODS.items(): diff --git a/xarray/core/rolling.py b/xarray/core/rolling.py index c00fac2b5bc..8cd4df74c84 100644 --- a/xarray/core/rolling.py +++ b/xarray/core/rolling.py @@ -3,7 +3,7 @@ from __future__ import print_function import numpy as np import warnings -from distutils.version import StrictVersion +from distutils.version import LooseVersion from .pycompat import OrderedDict, zip from .common import ImplementsRollingArrayReduce, full_like @@ -51,7 +51,7 @@ def __init__(self, obj, min_periods=None, center=False, **windows): """ if (has_bottleneck and - (StrictVersion(bn.__version__) < StrictVersion('1.0'))): + (LooseVersion(bn.__version__) < LooseVersion('1.0'))): warnings.warn('xarray requires bottleneck version of 1.0 or ' 'greater for rolling operations. Rolling ' 'aggregation methods will use numpy instead' diff --git a/xarray/tests/__init__.py b/xarray/tests/__init__.py index 851e9f0b724..d31d9cfe56c 100644 --- a/xarray/tests/__init__.py +++ b/xarray/tests/__init__.py @@ -3,7 +3,7 @@ from __future__ import print_function import warnings from contextlib import contextmanager -from distutils.version import StrictVersion +from distutils.version import LooseVersion import numpy as np from numpy.testing import assert_array_equal @@ -70,7 +70,7 @@ try: import bottleneck - if StrictVersion(bottleneck.__version__) < StrictVersion('1.0'): + if LooseVersion(bottleneck.__version__) < LooseVersion('1.0'): raise ImportError('Fall back to numpy') has_bottleneck = True except ImportError: