From ddcca89aceaaf13c4c74fe81bf9323b8018b004d Mon Sep 17 00:00:00 2001 From: Mathieu Le Marec - Pasquet Date: Mon, 23 Apr 2018 10:17:41 +0200 Subject: [PATCH] Compat with pip10+ This fixes #2001 Signed-off-by: Mathieu Le Marec - Pasquet --- setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 1153f784b..c6defb6ef 100644 --- a/setup.py +++ b/setup.py @@ -5,13 +5,17 @@ import os import sys -import pip + +try: + from pip import get_installed_distributions +except ImportError: + from pip._internal import get_installed_distributions from setuptools import setup, find_packages try: if 'docker-py' in [ - x.project_name for x in pip.get_installed_distributions()]: + x.project_name for x in get_installed_distributions()]: print( 'ERROR: "docker-py" needs to be uninstalled before installing this' ' package:\npip uninstall docker-py', file=sys.stderr