From d1026b2e4ca0092156dbf7b10aae2c94ea19a7bd Mon Sep 17 00:00:00 2001 From: AmulyaShetty11 <137149903+AmulyaShetty11@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:41:22 +0530 Subject: [PATCH] "Solving issue #939 on setup.py" --- 10 | 0 components/core/setup.py | 12 +++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 10 diff --git a/10 b/10 new file mode 100644 index 00000000..e69de29b diff --git a/components/core/setup.py b/components/core/setup.py index cff0c126..7daa53cd 100644 --- a/components/core/setup.py +++ b/components/core/setup.py @@ -3,7 +3,10 @@ import inspect import platform from setuptools import setup -from pip.req import parse_requirements +try: + from pip._internal.req import parse_requirements +except ImportError: + from pip.req import parse_requirements EMAIL_CONF = 'email.conf' DL_CONF = 'dl.conf' @@ -19,8 +22,11 @@ def read(file_name): requirements_path = os.path.join(base_dir, 'requirements.txt') install_reqs = parse_requirements(requirements_path, session=False) - -requirements = [str(ir.req) for ir in install_reqs] +requirements = list(requirements_path) +try: + requirements = [str(ir.req) for ir in install_reqs] +except: + requirements = [str(ir.requirement) for ir in install_reqs] ### Set configs ### if platform.system() == 'Linux':