What is the purpose of the c flag in the "conda install" command What is the purpose of the c flag in the "conda install" command python python

What is the purpose of the c flag in the "conda install" command


-c stands for --channel.It's used to specify a channel where to search for your package, the channel is often named owner.

The generic command is: conda install -c CHANNEL_NAME PACKAGE_NAME

For example, let's say you want to download pytorch. You can search on anaconda.org. You'll see that pytorch (the pacakge) is owned by pytorch.

enter image description here

Then, you'll just have to do a:

conda install -c pytorch pytorch


Copied from CLI after running conda install -h:

-c CHANNEL, --channel CHANNEL

Additional channel to search for packages. These are URLs searched in the order they are given (including file:// for local directories). Then, the defaults or channels from .condarc are searched (unless --override-channels is given). You can use 'defaults' to get the default packages for conda, and 'system' to get the system packages, which also takes .condarc into account. You can also use any name and the .condarc channel_alias value will be prepended. The default channel_alias is http://conda.anaconda.org/.

Channels are locations where Navigator and conda look for packages. (source) A package with the same name may exist on multiple channels. If you wish to install from other than the default channel, than one way of specifying which channel to use, is to use the conda install -c channel_name package_name syntax.Also read this for a description of install process using channels.