Installing Packages from Multiple Servers from One or More Requirements File

前端 未结 1 620
青春惊慌失措
青春惊慌失措 2020-12-06 06:08

I have tried the following two approaches without success.

The first with Cascading Requirements Files.

# requirements.txt
-r requirements/req2.txt
-         


        
相关标签:
1条回答
  • 2020-12-06 07:03

    The solution in either case is to add --extra-index-url <url> at the beginning of the requirements.txt file.

    Example:

    # requirements.txt
    --extra-index-url https://testpypi.python.org/pypi
    Django==1.7.7
    django-stackexchange-feed==0.4
    

    Or to use Cascading Requirements Files:

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

    pip install -r requirements.txt will now work.

    0 讨论(0)
提交回复
热议问题