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

Alessandro Messori picture Alessandro Messori · Feb 23, 2019 · Viewed 10.2k times · Source

I'm learning to setup python environments using conda, and I noticed that on the anaconda cloud website they recommend installing packages using the sintax

conda install -c package

However on the conda documentation they use the same command without the c flag.

Could anyone explain to me what is the purpose of the c flag and when should it be used?

Answer

RobinFrcd picture RobinFrcd · Feb 23, 2019

-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