I have "extras_require" declared in setup.py. Is there a way I can specify optional features with something like python setup.py[extras] install
.
I know that pip
can handle optional features like:
pip install .[extras]
or
pip install -e .[extras]
Is there something like python setup.py install [extras]
or python setup.py develop [extras]
that can do the similar things. Or is there another way to tell python setup.py
to install some optional requirements.
extras_require. A dictionary mapping names of “extras” (optional features of your project) to strings or lists of strings specifying what other distributions must be installed to support those features.
Installing Python Packages with Setup.py To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.
pip is a package manager, which can install, upgrade, list and uninstall packages, like familiar package managers including: dpkg, apt, yum, urpmi, ports etc. Under the hood, it will run python setup.py install , but with specific options to control how and where things end up installed. In summary: use pip .
python setup.py install easy_install pkg_name[extras]
or
python setup.py develop easy_install pkg_name[extras]
This of course requires pkg_name
to already exist in the search paths. It shouldn't install pkg_name
a second time since the install
/develop
option would've already installed it. However the extras
will be processed.
The advantage of this over pip install (options) .[extras]
is that you can pass specific options to build
/install
/develop
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With