diff --git a/setup.py b/setup.py index 5e96e96b8eca3c980b5308c34747abb36ddef5d7..963f0f1372a2a3d136a6408f8e67d597dc9bc7b2 100644 --- a/setup.py +++ b/setup.py @@ -19,16 +19,11 @@ from __future__ import print_function import platform +import six from setuptools import find_packages from setuptools import setup -from paddlehub.version import hub_version - - -def python_version(): - return [int(v) for v in platform.python_version().split(".")] - -max_version, mid_version, min_version = python_version() +from paddlehub.version import hub_version REQUIRED_PACKAGES = [ 'six >= 1.10.0', 'protobuf >= 3.6.0', 'pyyaml', 'Pillow', 'requests', @@ -36,7 +31,7 @@ REQUIRED_PACKAGES = [ 'sentencepiece', 'nltk', 'colorlog', 'opencv-python' ] -if max_version < 3: +if six.PY2: REQUIRED_PACKAGES += ["numpy < 1.17.0", "pandas < 0.25.0"] else: REQUIRED_PACKAGES += ["numpy", "pandas"]