diff --git a/setup.py b/setup.py index e1e46109ba..3064f5e75c 100644 --- a/setup.py +++ b/setup.py @@ -50,11 +50,11 @@ # ensure there is some tensorflow build with version above 1.4 import pkg_resources tf_pkg = None -for tf_pkg_name in ['tensorflow', 'tensorflow-gpu', 'tf-nightly', 'tf-nightly-gpu']: +for tf_pkg_name in ['tensorflow', 'tensorflow-gpu', 'tf-nightly', 'tf-nightly-gpu', 'tensorflow-macos']: try: tf_pkg = pkg_resources.get_distribution(tf_pkg_name) except pkg_resources.DistributionNotFound: pass assert tf_pkg is not None, 'TensorFlow needed, of version above 1.4' -from distutils.version import LooseVersion -assert LooseVersion(re.sub(r'-?rc\d+$', '', tf_pkg.version)) >= LooseVersion('1.4.0') +from packaging.version import parse +assert parse(re.sub(r'-?rc\d+$', '', tf_pkg.version)) >= parse('1.4.0')