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

Getting error when installing from git repo #190

Open
doronbehar opened this issue May 23, 2018 · 3 comments
Open

Getting error when installing from git repo #190

doronbehar opened this issue May 23, 2018 · 3 comments

Comments

@doronbehar
Copy link

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)
@guyzmo
Copy link
Owner

guyzmo commented May 30, 2018

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 :)

@nikitavbv
Copy link
Contributor

nikitavbv commented Jun 18, 2018

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:

  1. List requirements in setup.py separately from requirements.txt in a proper way.
  2. Just change current code a bit to adapt to pip changes: they have moved req to _internal, so something like from pip._internal import req should work. But that is a hack, not a good solution :)
  3. 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?

@nikitavbv
Copy link
Contributor

I pushed PR #191, which fixes this issue

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

3 participants