ElpieKay
ElpieKay

Reputation: 30888

How can we force pip to use the specified package index for dependencies?

We have a self-hosted python package index. When I tried to install cpplint by

py -2 -m pip install cpplint -i ${self_hosted_package_index} --trusted-host ${self_host}

it succeeded to download cpplint package, but then failed to download pytest_runner package from https://files.pythonhosted.org/packages which my computer is blocked from. As a result, pip install failed.

I solved the problem by running py -2 -m pip install pytest_runner -i ${self_hosted_package_index} --trusted-host ${self_host} first.

Is there any way to force pip install to use the specified index for all involved packages? Thanks.

Upvotes: 1

Views: 159

Answers (1)

phd
phd

Reputation: 94676

pytest-runner is declared as a dependency in cpplint's setup.py in setup_requires. setup_requires dependencies are installed using easy_install which seems to doesn't know about your index URL; perhaps pip doesn't pass it the URL.

So no, in this particular case (cpplint) it's not possible. For most other packages it should be ok.

Upvotes: 1

Related Questions