Using “-t” option inside a requirements.txt file

前端 未结 2 1798
一整个雨季
一整个雨季 2021-01-24 15:45

When I have, for example, a requirements-dev.txt and a requirements.txt, I know I can have -r requirements.txt inside requirements-d

相关标签:
2条回答
  • 2021-01-24 15:52

    As of today (in pip version 20.0.2), the -t, --target <dir> option is not supported in requirements.txt files. The section "Requirements File Format" of pip's User guide lists the currently supported options:

    • -i, --index-url
    • --extra-index-url
    • --no-index
    • -c, --constraint
    • -r, --requirement
    • -e, --editable
    • -f, --find-links
    • --no-binary
    • --only-binary
    • --require-hashes
    • --pre
    • --trusted-host
    0 讨论(0)
  • 2021-01-24 15:56
    pip install -r requirements.txt -t /path/to/install
    

    This should work. It worked for me.

    If you want different modules to be installed to different locations, then I think you might have to put them into multiple requirements text files. This is at least as far as I know

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