3

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?

OrangeDog
  • 36,653
  • 12
  • 122
  • 207

3 Answers3

3

It appears that the issue has been raised but not resolved

TomNash
  • 3,147
  • 2
  • 21
  • 57
2

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.

Tagar
  • 13,911
  • 6
  • 95
  • 110
1

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
jeffmcc
  • 263
  • 3
  • 9