diff --git a/conda/faiss-gpu-raft/meta.yaml b/conda/faiss-gpu-raft/meta.yaml index 84aa826c6c..b01fb6d695 100644 --- a/conda/faiss-gpu-raft/meta.yaml +++ b/conda/faiss-gpu-raft/meta.yaml @@ -84,6 +84,7 @@ outputs: run: - python {{ python }} - numpy >=1.19,<2 + - packaging - {{ pin_subpackage('libfaiss', exact=True) }} test: requires: diff --git a/conda/faiss-gpu/meta.yaml b/conda/faiss-gpu/meta.yaml index e7b839975f..7cc6e4ff3d 100644 --- a/conda/faiss-gpu/meta.yaml +++ b/conda/faiss-gpu/meta.yaml @@ -82,6 +82,7 @@ outputs: run: - python {{ python }} - numpy >=1.19,<2 + - packaging - {{ pin_subpackage('libfaiss', exact=True) }} test: requires: diff --git a/conda/faiss/meta.yaml b/conda/faiss/meta.yaml index a0431a4041..c4d66ca0d3 100644 --- a/conda/faiss/meta.yaml +++ b/conda/faiss/meta.yaml @@ -78,6 +78,7 @@ outputs: run: - python {{ python }} - numpy >=1.19,<2 + - packaging - {{ pin_subpackage('libfaiss', exact=True) }} test: requires: diff --git a/faiss/python/loader.py b/faiss/python/loader.py index eb60bf6800..8cc97f2f44 100644 --- a/faiss/python/loader.py +++ b/faiss/python/loader.py @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -from distutils.version import LooseVersion +from packaging.version import Version import platform import subprocess import logging @@ -25,7 +25,7 @@ def supported_instruction_sets(): {"NEON", "ASIMD", ...} """ import numpy - if LooseVersion(numpy.__version__) >= "1.19": + if Version(numpy.__version__) >= Version("1.19"): # use private API as next-best thing until numpy/numpy#18058 is solved from numpy.core._multiarray_umath import __cpu_features__ # __cpu_features__ is a dictionary with CPU features diff --git a/faiss/python/setup.py b/faiss/python/setup.py index 1c9101290d..3b4f2e9c83 100644 --- a/faiss/python/setup.py +++ b/faiss/python/setup.py @@ -69,7 +69,7 @@ license='MIT', keywords='search nearest neighbors', - install_requires=['numpy'], + install_requires=['numpy', 'packaging'], packages=['faiss', 'faiss.contrib'], package_data={ 'faiss': ['*.so', '*.pyd'],