Skip to content

How to install local wheels whose requirement specifiers are VCS project urls? #3185

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

Closed
RussellLuo opened this issue Oct 15, 2015 · 2 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@RussellLuo
Copy link

From the documentation, I learned this:

To build wheels for your requirements and all their dependencies to a local directory:

pip install wheel
pip wheel --wheel-dir=/local/wheels -r requirements.txt

And then to install those requirements just using your local directory of wheels (and not from PyPI):

pip install --no-index --find-links=/local/wheels -r requirements.txt

The pip install --no-index --find-links=/local/wheels -r requirements.txt command works well if all dependencies in the requirements.txt are in the format of PyPI requirement specifiers:

flask
requests

But if any dependency in the requirements.txt is in the form of VCS project url, which is reasonable for non-PyPI or development-version packages. Like this:

git+https://github.com/mitsuhiko/flask.git#egg=flask
git+https://github.com/kennethreitz/requests.git#egg=requests

The pip install command will download packages by cloning their repositories (as the pip wheel command has done), instead of using the local wheels.

How to fix it?

@RussellLuo RussellLuo changed the title How to install local wheels whose requirement specifier is a VCS project url? How to install local wheels whose requirement specifier are VCS project urls? Oct 15, 2015
@RussellLuo RussellLuo changed the title How to install local wheels whose requirement specifier are VCS project urls? How to install local wheels whose requirement specifiers are VCS project urls? Oct 15, 2015
@RussellLuo
Copy link
Author

For those who encountered the same issue, I have figured out a solution:

$ WHEELS=$(cd /local/wheels; ls -1 *.whl | awk -F - '{ gsub("_", "-", $1); print $1 }' | uniq)
$ pip install --no-index --find-links=/local/wheels $WHEELS

@dstufft
Copy link
Member

dstufft commented Mar 24, 2017

Closing as a duplicate of #3355/

@dstufft dstufft closed this as completed Mar 24, 2017
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 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
Projects
None yet
Development

No branches or pull requests

2 participants