Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with pip version > 10 #59

Open
Frozander opened this issue Oct 26, 2019 · 1 comment
Open

Building with pip version > 10 #59

Frozander opened this issue Oct 26, 2019 · 1 comment

Comments

@Frozander
Copy link

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
Copy link
Author

Created pull request #60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant