git-repo
git-repo copied to clipboard
Getting error when installing from git repo
Here is the error:
Processing /home/doron/repos/git-repo
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-sxu0n8_f/setup.py", line 169, in <module>
install_requires=requirements(),
File "/tmp/pip-req-build-sxu0n8_f/setup.py", line 125, in requirements
requirements = pip.req.parse_requirements(
AttributeError: module 'pip' has no attribute 'req'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-sxu0n8_f/
My pip --version
is:
pip 10.0.1 from /home/doron/.local/share/virtualenvs/git-repo-6JSdEnFI/lib/python3.6/site-packages/pip (python 3.6)
uh.. looks like pip 10 did a major API change. As I've heard, pip integrated a bunch of hacks that was necessary into the project, and changed a bunch of its internals. So I need to check the new better way of doing things and update this :)
I'm open to suggestions/pointers to help me expedite this, as I'm being currently snowed with paying work :)
I'm open to suggestions/pointers to help me expedite this, as I'm being currently snowed with paying work :)
Generally, it is not a good practice to read requirements.txt
from setup.py
and install_requires
should be listed in setup.py
separately from requirements.txt
. There is a really good explanation for this on StackOverflow.
There are three possible solutions:
- List requirements in
setup.py
separately fromrequirements.txt
in a proper way. - Just change current code a bit to adapt to pip changes: they have moved
req
to_internal
, so something likefrom pip._internal import req
should work. But that is a hack, not a good solution :) - Just read requirements.txt as file and use its lines for
install_requires
. Some repos followed this way: example.
I would be happy to help to solve this issue (incl. pull request).
What are your thoughts on this?
I pushed PR #191, which fixes this issue