-
Notifications
You must be signed in to change notification settings - Fork 21
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
no module named pip.req #8
Comments
Got the same problem using python 3.7.0 (Anaconda). |
how can this be circumvented? I have the same installation issue with Python 3.8 and anaconda. |
I would be satisfied to merge a PR moving the requirements into the setup.py file, as in this repo. |
thanks for the pointer, this seems to do the trick on my system but it is also the first time that I am fiddling with a diff --git a/setup.py b/setup.py
index 1e085af..f14817f 100644
--- a/setup.py
+++ b/setup.py
@@ -1,15 +1,18 @@
from setuptools import setup
-try: # for pip >= 10
- from pip._internal.req import parse_requirements
-except ImportError: # for pip <= 9.0.3
- 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
# parse_requirements() returns generator of pip.req.InstallRequirement objects
-install_reqs = parse_requirements('requirements.txt', session=False)
+#install_reqs = parse_requirements('requirements.txt', session=False)
+
+with open("requirements.txt") as reqs_file:
+ reqs = [line.strip() for line in reqs_file]
# reqs is a list of requirement
# e.g. ['django==1.5.1', 'mezzanine==1.4.6']
-reqs = [str(ir.req) for ir in install_reqs]
+#reqs = [str(ir.req) for ir in install_reqs]
|
Yes, adding |
Every time I tried to install the develop version of the atmos package either via `pip install` or `pipenv install`, I was facing an error most likely related to the issue that was addresed in issue #8. The `req` module has been moved to the `pip._internal.req` submodule, so the try except in `setup.py` seems to solve the issue of importing the `parse_requirements` function. However, some extra changes might have happened on the `pip` side, because apparently, now, the `ParsedRequirement` class has had its `req` attribute renamed to `requirement`, which caused an `AttributeError`. I solved this in my machine via another try and except clause that should handle older and newer pip versions.
setup.py
seems to currently suffer from this problem, will need to fix it at some point.The text was updated successfully, but these errors were encountered: