Windows-10-Toast-Notifications icon indicating copy to clipboard operation
Windows-10-Toast-Notifications copied to clipboard

Building with pip version > 10

Open Frozander opened this issue 6 years ago • 1 comments

So while building the project, I have encountered an issue with pip module while in setup.py

In pip versions greater than 10 parse_requirements is in pip._internal.req instead of pip.req. Here is a snippet on how I fixed it.

diff --git a/setup.py b/setup.py
index 8ead33e..a1ef1ad 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,10 @@
 from operator import attrgetter
 from os import path
 
-from pip.req import parse_requirements
+try: # for pip >= 10
+    from pip._internal.req import parse_requirements
+except ImportError: # for pip <= 9.0.3
+    from pip.req import parse_requirements
 from setuptools import setup
 
 def read(fname):

Frozander avatar Oct 26 '19 09:10 Frozander

Created pull request #60

Frozander avatar Oct 26 '19 09:10 Frozander