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

Pip install git repo as egg fails when specifying target #4139

Closed
varyag00 opened this issue Nov 24, 2016 · 4 comments
Closed

Pip install git repo as egg fails when specifying target #4139

varyag00 opened this issue Nov 24, 2016 · 4 comments
Labels
auto-locked Outdated issues that have been locked by automation C: target pip install's --target option's behaviour handling C: vcs pip's interaction with version control systems like git, svn and bzr

Comments

@varyag00
Copy link

varyag00 commented Nov 24, 2016

  • Pip version: 9.0.1, 8.1.2
  • Python version: 2.7, 3.5
  • Operating System: Mac OS X El Capitan

Description:

We have a python 2/3 compatible application and are using PyPI packages in conjunction with several private github repos. We're using a requirements.txt file to specify dependencies, in the form:

-e git://github.com/3ptscience/properties@dev#egg=<name> #OSS repo at a certain branch
-e git+ssh://[email protected]/3ptscience/project.git#egg=project # private repo
-e .

When run with pip install -r requirements.txt -t lib/ I expect the packages to get installed as eggs to the lib directory, however instead I get the following error:

$ pip install -r requirements.txt -t lib/
Installing collected packages: six, properties, pygelf, vine, amqp, kombu, logbook, metronome, webapp2, webob, future, audition, MarkupSafe, jinja2, jinja2-registry, mistune, minimals
  Found existing installation: properties 0.3.0b0
    Uninstalling properties-0.3.0b0:
      Successfully uninstalled properties-0.3.0b0
  Running setup.py develop for properties
    Complete output from command /Users/dan/anaconda/bin/python -c "import setuptools, tokenize;__file__='/Users/dan/git/testing/project/src/properties/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps --home=/var/folders/84/18pfy09s333gylfsfmqkx0140000gn/T/tmpLiZsAN:
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help

    error: option --home not recognized

    ----------------------------------------
  Rolling back uninstall of properties
Command "/Users/dan/anaconda/bin/python -c "import setuptools, tokenize;__file__='/Users/dan/git/testing/project/src/properties/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps --home=/var/folders/84/18pfy09s333gylfsfmqkx0140000gn/T/tmpLiZsAN" failed with error code 1 in /Users/dan/git/testing/project/src/properties/

This happens for both private and public repos, with or without -e ., and with either multiple or a single repository listed in the requirements.txt (and all permutations thereof). It does not happen when I install a PyPI package such as pip install requests, even when installing from a requirements.txt to a target via pip install requirements_no_git.txt -t lib/ (as long as requirements.txt contains no git repos).

I am fairly sure the requirements.txt file is correctly formatted as running pip install -r requirements.txt succeeds and correctly installs the packages (even when containing git repos).

What I've run:

One workaround I've found works is to separate the deps into two requirements files, requirements.txt and requirements_no_git.txt, where requirements.txt contains all the git repos and ``requirements_dev.txtcontains all the PyPI packages. Then I simply run pip install requirements.txt`
Then rename the folder to lib
`mv src lib`
Then install the PyPI packages to the `lib` target
`pip install -r requirements.txt -t lib`

This gets generally the same results a simply installing all to lib/, but it is still inconvenient.

@dstufft
Copy link
Member

dstufft commented Mar 30, 2017

Closing to move a bunch of related issues to a single issue: #4390.

@dstufft dstufft closed this as completed Mar 30, 2017
@xavfernandez xavfernandez added the C: target pip install's --target option's behaviour handling label Mar 30, 2017
@cjerdonek cjerdonek added the C: vcs pip's interaction with version control systems like git, svn and bzr label Aug 5, 2018
@cjerdonek
Copy link
Member

@varyag00 Does it work as expected if you remove the -e option from each line containing a source control url?

@cjerdonek
Copy link
Member

Looks like this is a duplicate of #562.

@lock
Copy link

lock bot commented Jun 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: target pip install's --target option's behaviour handling C: vcs pip's interaction with version control systems like git, svn and bzr
Projects
None yet
Development

No branches or pull requests

4 participants