Reputation: 43
With pip
we can install subpackages using square brackets. For example with Apache Airflow:
pip install airflow[all]
Is there something similar in conda
or do I have to use pip
for packages containing sub-packages?
Upvotes: 4
Views: 1928
Reputation: 285
It appears there is still (July 2023) no equivalent to install package extras in conda.
This 2021 conda Enhancement is shown in Planning stage: ENH: More powerful syntax for build variants & optional package-extras
To install the pandas[excel]
extras, I expanded the list, and installed each of them indiviually, a la:
mamba --no-banner install --name conda-env -c conda-forge \
openpyxl \
pyxlsb \
xlrd \
xlsxwriter
Upvotes: 2
Reputation: 14939
There is no direct equivalent of this in conda
Closest alternative would be to create your own matapackages that describe list of dependencies. Although this is not exactly what pip
provides here.
Another option is to use conda outputs that allows to explicitly specifies packaging steps.
On top of all, please visit this Github page and upvote "Optional groups of dependencies" feature request
https://github.com/conda/conda/issues/7502
If "Optional groups of dependencies" for conda are implemented, it would be a direct equivalent for that existing pip
functionality.
Upvotes: 3