0

I am trying to deploy a Django app to Heroku where one of the required packages lives on https://testpypi.python.org/pypi and of course Django is on the main PyPI server.

My setup looks like this.

# requirements.txt
-r requirements/req2.txt
-r requirements/req3.txt
# requirements/req2.txt
Django==1.7.7
# requirements/req3.txt
-i https://testpypi.python.org/pypi
foo-bar==0.4

Running the command: pip install -r requirements.txt results in the following error.

Could not find any downloads that satisfy the requirement 
Django==1.7.7 (from -r ./requirements/req2.txt (line 2))
No distributions at all found for Django==1.7.7 
(from -r ./requirements/req2.txt (line 2))

So to me it looks like the -i argument in req3 is being set then pip tries to look for Django on the testpypi server.

I tried adding -i https://pypi.python.org/pypi to req2.txt but I still get the same error. (perhaps https://pypi.python.org/pypi is the wrong url)

In addition if I run either req*.txt file individually the installation of the package is successful?

How can one cascade requirements files and use private indexes?

Admittedly this question and this one are quite similar but neither deal with private indexs

Community
  • 1
  • 1
robbmj
  • 16,085
  • 8
  • 38
  • 63
  • I am voting to close this question as I believe it is an XY question and http://stackoverflow.com/questions/29289695/pip-how-to-install-packages-from-multiple-servers-from-a-requirements-file. is a better version of the same question. – robbmj Mar 26 '15 at 22:05

1 Answers1

1

It turns out that the correct method of dealing with private indexes is to use --extra-index-url switch. From the documentation of pip:

Note that using --index-url removes the use of PyPI, while using --extra-index-url will add additional indexes.

So, putting the line

--extra-index-url https://testpypi.python.org/pypi

on top of your requirements.txt should be enough. No need to cascade at all!

Selcuk
  • 57,004
  • 12
  • 102
  • 110