Fix dist_utils so it also works with pip 10.0.
@@ -25,9 +25,21 @@ GET_PIP = 'curl https://bootstrap.pypa.io/get-pip.py | python'
try:
import pip
+except ImportError as e:
+ print('Failed to import pip: %s' % (str(e)))
+ print('Download pip:\n', GET_PIP)
+ sys.exit(1)
+
+try:
+ # pip < 10.0
from pip.req import parse_requirements
except ImportError:
- print('Download pip:\n', GET_PIP)
+ # pip >= 10.0
+
+ try:
+ from pip._internal.req.req_file import parse_requirements
+ except ImportError:
+ print('Failed to import parse_requirements from pip: %s' % (str(e)))
sys.exit(1)
__all__ = [
