Skip to content

Installing dependencies from local paths or git repositories using --find-links #5164

New issue

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

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

Already on GitHub? # to your account

Closed
timhoffm opened this issue Apr 4, 2018 · 4 comments
Labels
auto-locked Outdated issues that have been locked by automation type: support User Support

Comments

@timhoffm
Copy link

timhoffm commented Apr 4, 2018

  • Pip version: 9.0.3
  • Python version: 2.7.6
  • Operating system: Ubuntu

Description:

I would like to install dependencies from local paths/git repositories without specifying the exact path as part of the package. I figure, that --find-links can be used to provide the necessary paths when installing. The doc says

If a local path or file:// url that's a directory, then look for archives in the directory listing.

Not sure if this mean I really would have to package the dependencies.

Requirements.txt works

I can install dependencies via pip install -r requirements.txt from local directories or bare git repositories using

# requirements.txt
file:///home/tim/workspace/mypackage#egg=mypackage --no-index

or

# requirements.txt
git+file:///repos/gitroot/mypackage.git#egg=mypackage --no-index

--find-links does not work

I would assume that the same thing should be possible via install_requires='mypackage' in setup.py and

pip install package-requireing-mypackage --find-links file:///home/tim/workspace/mypackage#egg=mypackage --no-index

or

pip install package-requireing-mypackage --find-links git+file:///repos/gitroot/mypackage.git#egg=mypackage --no-index

Unfortunately none of these works ("No matching distribution found for mypackage").

The documentation on --find-links is bit short and I don't know if this is supposed to work or if I would have to adapt my call.

@pfmoore
Copy link
Member

pfmoore commented Apr 4, 2018

--find-links should point at a directory containing wheel or sdist files. You cannot use source checkouts with --find-links.

@pradyunsg pradyunsg added the type: support User Support label Apr 4, 2018
@timhoffm
Copy link
Author

timhoffm commented Apr 4, 2018

Thanks for the quick reply.

Is there any way to configure source checkouts or git repos as sources for install_requires dependencies?

@xavfernandez
Copy link
Member

With #5571 being merged, it will be possible to use urls in install_requires in upcoming pip 18.1.

@lock
Copy link

lock bot commented Jun 1, 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 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 1, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
auto-locked Outdated issues that have been locked by automation type: support User Support
Projects
None yet
Development

No branches or pull requests

4 participants