Specify extras_require with pip install -e

前端 未结 3 1791
迷失自我
迷失自我 2020-12-09 07:11

How can one manage to install extras_requires with pip when installing from a git repository ?

I know that you can do pip install project[extra] when th

相关标签:
3条回答
  • 2020-12-09 07:55

    This also works when installing from a whl file so, for example, you can do:

    pip install path/to/myapp-0.0.1-py3-none-any.whl[extra1]
    

    This is very far from clear from the docs, and not particularly intuitive.

    0 讨论(0)
  • 2020-12-09 07:56

    Important to notice: you should not have whitespaces around or within brackets. I.e. this won't work: -e ". [extra1, extra2]" - and even as a row in requirements.txt file, where it is not so obvious. The worst thing about it is that when you have whitespace, extras are just silently ignored.

    0 讨论(0)
  • 2020-12-09 08:01

    This should work, per example #6

    For remote repos:

    pip install -e git+https://github.com/user/project.git#egg=project[extra]
    

    And this for local ones (thanks to @Kurt-Bourbaki):

    pip install -e .[extra]
    
    0 讨论(0)
提交回复
热议问题