From e273491684868e006257a396c80043693503f83a Mon Sep 17 00:00:00 2001 From: Jonathan Karr Date: Mon, 24 Feb 2020 14:48:08 -0500 Subject: [PATCH] replacing unstable pip API with subprocess and sys.executable --- setup.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 16808de..0f68b6b 100644 --- a/setup.py +++ b/setup.py @@ -2,13 +2,10 @@ try: import pkg_utils except ImportError: - import pip - pip_version = tuple(pip.__version__.split('.')) - if pip_version >= ('19', '3', '0'): - import pip._internal.main as pip_main - elif pip_version >= ('19', '0', '0'): - import pip._internal as pip_main - pip_main.main(['install', 'pkg_utils']) + import subprocess + import sys + subprocess.check_call( + [sys.executable, "-m", "pip", "install", "pkg_utils"]) import pkg_utils import os