Fix setup bug
@@ -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"]
