Search code examples
pythonanacondajupytercondaconda-forge

How do you know which conda channel to install from?


When installing a package using conda intall, how do you know which channel to use?

  • conda install packagename (default channel)
  • conda install -c anaconda packagename
  • conda install -c conda-forge packagename
  • conda install -c some-other-channels packagename


I know people say channels don't really matter, but I came across the issue when installing jupyter -
When I tried conda install jupyter, there was an error ImportError: DLL load failed when setting up jupyter notebook. However when I tried conda install -c anaconda jupyter, it worked fine.

There are jupyter packages offered by different channels when you search on Anaconda Cloud .


Solution

  • The short answer is: you don't. I'd advise to use conda-forge as one having much wider selection of packages and their latest versions. There are also some other differences, e.g. conda-forge favours openblas over mkl that you can find in the default anaconda.

    Normally you should not worry about which channel to use, just add all the channels you need and ask conda to maintain priority:

    conda config --add channels conda-forge
    conda config --set channel_priority strict
    conda install <package>  
    

    I highly recommend this read in Anaconda docs that explains how it manages priorities and selects the right channel.

    There might be some rare cases, like yours, where for whatever reason the anaconda was a better choice. I'd hypothesize that it's because you opted for the old Jupyter. Mind that it's been years now since JupyterLab superseded Jupyter and there's less attention put into maintaining the old version (it's supposed to be only important bug and security fixes).

    It can also happen that the package you're looking for is neither in anaconda nor conda-defaults - or the version you find there is really old. If in doubt, search for the package either directly with conda or through the web site. For instance, for latest plotly I have to use plotly channel.