I have tried the following two approaches without success.
The first with Cascading Requirements Files.
# 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
pip install -r requirements.txt
results in pip
not finding Django.
The second attempt was to include both requirements in a single file:
-i https://pypi.python.org/pypi/
Django==1.7.7
-i https://testpypi.python.org/pypi
foo-bar==0.4
pip install -r requirements.txt
results in the same error, pip
not finding Django.
How can I use pip
to install packages from different servers/index-urls?
The solution in either case is to add
--extra-index-url <url>
at the beginning of therequirements.txt
file.Example:
Or to use Cascading Requirements Files:
pip install -r requirements.txt
will now work.