diff --git a/src/python/setup.py b/src/python/setup.py index 0dbd17b75a..e131af0698 100644 --- a/src/python/setup.py +++ b/src/python/setup.py @@ -179,11 +179,12 @@ def do_not_install(require): ): install_requires.append("llvmlite == 0.31.0") - if sys.version_info[0] == 3 and sys.version_info[1] == 8: - # Only 4.0 betas support Python 3.8 - install_requires.append("coremltools==4.0b3") - else: - install_requires.append("coremltools==3.3") + install_requires.append( + # Only 4.0 betas support Python 3.8 + "coremltools==4.0b3; python_version >= 3.8.0'," + if sys.version_info[0] == 3 and sys.version_info[1] == 8 + else "coremltools==3.3; python_version < 3.8.0" + ) if sys.platform == "darwin": install_requires.append("tensorflow >= 2.0.0")