Optional dependencies in a pip requirements file

前端 未结 3 535
旧巷少年郎
旧巷少年郎 2020-12-13 12:33

How can I specify optional dependencies in a pip requirements file?

According to the pip documentation this is possible, but the documentation doesn\'t explain how t

3条回答
  •  一生所求
    2020-12-13 13:27

    In 2015 PEP-0508 defined a way to specify optional dependencies in requirements.txt:

    requests[security]
    

    That means that yourpackage needs requests for its security option. You can install it as:

    pip install yourpackage[security]
    

提交回复
热议问题