justinmnoor justinmnoor - 22 days ago 13
Python Question

Should I use Conda or Conda Forge when creating Anaconda Python environments?

I understand that conda-forge was initiated to build and maintain packages.

But when building Anaconda Python environments, how do we know when to use 'conda-forge' verses 'conda install' if a package exists in both repositories? Django for example can be installed with both 'conda install' and 'conda-forge'.

Which one should we use? Does it matter?

Can someone give me a very brief 'conda-forge for dummies' lesson? The docs are very scant.



The short answer is that, in my experience generally, it doesn't matter which you use.

The long answer:

So conda-forge is an additional channel from which packages may be installed. In this sense, it is not any more special than the default channel, or any of the other hundreds (thousands?) of channels that people have posted packages to. You can add your own channel if you sign up at https://anaconda.org and upload your own Conda packages.

Here we need to make the distinction, which I think you're not clear about from your phrasing in the question, between conda, the cross-platform package manager, and conda-forge, the package channel. Continuum IO, the main developers of the conda software also maintain a separate channel of packages, which is the default when you type conda install packagename without changing any options.

There are two ways to change the options for channels. One is to specify a channel every time you install a package:

conda install -c some-channel packagename

Of course, the package has to exist on that channel. If you find yourself using the same channel often, then you might want to add it to your configuration. You can write

conda config --add channels some-channel

to add the channel some-channel to the top of the channels configuration list. This gives some-channel the highest priority (priority determines (in part) which channel is selected when more than one channel has a particular package). To add the channel to the end of the list and give it the lowest priority, type

conda config --append channels some-channel

With all of that said, there are three main reasons to use the conda-forge channel instead of the defaults channel maintained by Continuum:

  1. Packages on conda-forge may be more up-to-date than those on the defaults channel
  2. There are packages on the conda-forge channel that aren't available from defaults
  3. You would prefer to use a dependency such as openblas (from conda-forge) instead of mkl (from defaults).