A Guide to the Anaconda `defaults` channel
Anaconda Inc. (the company) has begun to threaten legal action against against commercial companies and has also advised non-profits to purchase licenses to the Anaconda software/distribution channels. While the situation is being resolved, some institutions have blocked the anaconda.org
domain completely.
This has been brewing for a number of years. The first change happened back in 2020, and the second happened very recently in March 2024 that affects “government entities and non-profit entities with over 200 employees or contractors”. This is problematic due the wording around ‘employees’ - many organisations have hundreds of employees but few users of conda
software.
In order to avoid any potential problems, avoiding defaults
channel is the best course of action.
Before we dive in, a quick recap on definitions:
- Anaconda Inc. is the commercial entity behind the
conda
,miniconda
, and theAnaconda.Navigator
software suite. - Anaconda Inc. curates a set of packages which are available through specific channels - also known as
defaults
channel - Miniforge is a non-Anaconda community-developed installer specific to
conda-forge
channel mamba
is a drop in replacement toconda
.- Far more detailed information on all the different channels/distributions can be found here.
All the hoohah surrounds the curated Anaconda channels, commonly referred to as defaults
channel. Note: When installing conda/miniconda
software, the defaults
channel is added to your global channels list. You could inadvertently be using Anaconda services without intending to.
How to’s
Below is guidance on how to best deal with defaults
channel.
Safest: Fresh Install of Miniforge distribution
- Install the conda-forge distribution
miniforge3
- instructions here, this will also installmamba
. - Add the channels
bioconda
andnodefaults
[in that order] as global defaults:
conda config --add channels bioconda nodefaults
Adding the nodefaults
channel to the global conda config will disable defaults
in all newly created environments, see also the docs and below.
That’s it!
Best: Current Miniforge
install:
Note miniconda
users: The below solution is only for miniforge
installs. See below for more details.
- To check if your installation (regardless if that’s
anaconda
,miniconda
,miniforge
, etc.) has thedefaults
channel in your global configuration :
conda config --show channels
# or more informative:
conda config --get
- Now remove
defaults
:conda config --remove channels defaults
- Check
defaults
is removed:conda config --show channels
-
Double check that
defaults
is not accessible, this should fail to installanaconda-fonts
:# This will access defaults channel! conda install fonts-anaconda
If the above succeeds, see below.
Done!
Dangerous: Conda/Miniconda
It’s tricky to fully decouple your conda usage from the defaults
channel, because it is hard-coded in some places the miniconda
code.
During the writing of this post, a colleague could not stop their miniconda
installation from using the defaults
channel, even when defaults
was not in the channels list (we double and triple checked everything). After testing, several people also observed the same issue. We (thanks James and Helena) eventually tracked the bug to (we think) the miniconda
+ libmamba
solver.
The conda developers have deprecated the implicit adding defaults
and are moving to remove it completely.
The safest option is to install the conda-forge
distribution. This has the added benefit of installing mamba
from the very beginning and is the recommended method of installation by the mamba
devs.
To test your setup, remove the defaults
channel (see above) try to install fonts-anaconda
, which is accessible only via defaults
. Warning: this will access the Anaconda defaults channel! Also check to see if you are using the classic
or libmamba
solver by running conda config --show | grep "solver:"
It is far simpler to install miniforge3
.
Protecting against defaults
channel
It’s possible to protect users of your pipelines/tools by including nodefaults
channel in a conda.yaml
file. For example:
channels:
- conda-forge
- bioconda
- nodefaults
This will override the defaults channel if it exists in the users global config. Unfortunately, this is specific to conda env
subcommand, therefore it will not work for conda install
or conda create
when added to global config. There is an open issue on github for this feature.
FAQs + FYIs
- How can I transition safely from defaults
channel?
If you are worried removing defaults
will break your current setup, conda-forge
has great documentation on how to test and transition from your addiction to defaults
.
- Be wary of foreign conda.yaml
files in software/pipelines
Lots of pipelines/tools will use conda.yaml
to enable easy installation of dependencies. It’s very likely defaults
could be in a conda.yaml
file because it’s been the… default to include it.
Unfortunately as far as I know, there is no setting or method available to protect against a conda.yaml
using a package from defaults
.
There is a feature request for nodefaults
to apply everywhere.
I suggest always double checking foreign conda.yaml
files before installing.
- Will removing defaults
interfere with the install of bioinfo tools?
Very unlikely. conda-forge
transitioned away from Anaconda’s defaults
channel in 2021 and has continued to diverge in both names and recipes. There is a slight chance it may cause issues for old pre 2020/2021 recipes but this is rare as recipes have continually been updated. Not too worry though, conda-forge
is community driven, feel free to contribute if you run into any problems!
Anecdotally, several people including myself have been operating without defaults
channel for over a year. We’ve not had any issues.
- What about bioconda
packages?
bioconda
channel has always had strong dependencies on conda-forge
. Therefore, dropping defaults
will have little to no effect. If you are worried see above on how to transition from defaults
.
- How can I see if packages were installed from defaults
?
Run this command to show the source of packages in the current actived environment:
conda list --show-channel-urls | grep "defaults"
Add --name ENV
to inspect a specific environment without activing it.
If nothing appears, you’re golden!
- My institution has blocked anaconda.org
. What do I do?!
Prefix.dev
, the German company behind the all-in-one pixi
software manager has setup mirrors of both conda-forge
and bioconda
channels:
https://prefix.dev/channels/conda-forge
https://prefix.dev/channels/bioconda
Follow these instructions to configure the mirrors.
- Be careful of channel leakage
I came across this interesting issue on github defaults channels leak into environments config. The summary is that due to how conda merges (not replaces) config files, your primary .condarc
file could leak into other envs. More info on conda’s configuration engine can be found here and the documentation is here.
Again, the safest option is to remove defaults
from your .condarc
(see above).
Questions? Ask in the comments below!
See Also
- Lee Katz has written a fantastic blog on how to use the
pixi
to do all things software related. - Another ubinfie blogs deals with setting up a multi-user conda installation. Check it out!
Comments