From 5a829a9e3d8d56c811afcd72dd48835797ad8e28 Mon Sep 17 00:00:00 2001 From: wuzewu Date: Fri, 19 Apr 2019 16:18:23 +0800 Subject: [PATCH] add setup install requires enum in python 2.x --- setup.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup.py b/setup.py index 78d67539..acf315fe 100644 --- a/setup.py +++ b/setup.py @@ -16,15 +16,27 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function +import platform + 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() + REQUIRED_PACKAGES = [ 'numpy >= 1.12.0', 'six >= 1.10.0', 'protobuf >= 3.1.0', 'pyyaml', 'Pillow', "visualdl >= 1.3.0" ] +if max_version < 3: + REQUIRED_PACKAGES += ["enum"] + setup( name='paddlehub', version=hub_version.replace('-', ''), -- GitLab