8.2.11 Using the .condarc Conda Configuration File
Overview
Note:
A .condarc file can also be used in an administrator-controlled installation to override the users’ configuration. See Administering a multi-user Conda Installation.- Where Conda looks for packages.
- If and how Conda uses a proxy server.
- Where Conda lists known environments.
- Whether to update the Bash prompt with the currently activated environment name.
- Whether user-built packages should be uploaded to Anaconda.org.
- What default packages or features to include in new environments.
Creating and Editing
The .condarc file is not included by default, but it is automatically created in your home directory the first time you run the Conda Config command. To create or modify a .condarc file, open a terminal and enter the conda config command. The .condarc configuration file follows simple YAML syntax.
conda config --add channels conda-forge
Alternatively, you can open a text editor such as Notepad on Windows, TextEdit on MacOS,
or VS Code. Name the new file .condarc
and save it to your user home
directory or root directory. To edit the .condarc
file, open it from
your home or root directory and make edits in the same way you would with any other text
file. If the .condarc
file is in the root environment, it will override
any in the Home Directory.
You can find information about your file by typing Conda info in your terminal.
This will give you information about your
.condarc
file, including
where it is located.
You can also download a sample .condarc file to edit in your editor and save to your user Home Directory or Root Directory.
Example:
To set the auto_update_conda option to False, run:
conda config --set auto_update_conda False
For a complete list of Conda Config commands, see the command reference. The same list is available
at the terminal by running conda config --help
. You can also see the
Conda Channel Configuration for more
information.
Conda supports a wide range of configuration options. This page gives a non-exhaustive
list of the most frequently used options and their usage. For a complete list of all
available options for your version of conda, use the conda config
--describe
command.
Searching for .condarc
Conda looks in the following locations for a .condarc file
:
Figure 8-28 .Condarc file

XDG_CONFIG_HOME
is the path to where user-specific configuration files
should be stored defined following The XDG Base Directory Specification (XDGBDS).
Default to $HOME/.config
should be used.
CONDA_ROOT
is the path for your base conda install.
CONDA_PREFIX
is the path to the current active environment.
CONDARC
must be a path to a file named .condarc
,
condarc
, or end with a YAML suffix (.yml
or
.yaml
).
Note:
Any condarc files that exist in any of these special search path directories need to end in a valid yaml extension (".yml" or ".yaml").Conflict Merging Strategy
- Lists-merge
- Dictionaries-merge
- Primitive-clobber
Precedence
The precedence by which the Conda Configuration is built out is shown below. Each new arrow takes precedence over the ones before it. For example, config files (by parse order) will be superseded by any of the other configuration options. Configuration environment variables (formatted like CONDA_<CONFIG NAME>) will always take precedence over the other 3.
Figure 8-29 Config.precedence

Obtaining Information from the .condarc file
You can use the following commands to get the effective settings for conda. The effective settings are those that have merged settings from all the sources mentioned above.
To get all keys and their values:
conda config --get
To get the value of a specific key, such as channels:
conda config --get channels
To show all the configuration file sources and their contents:
conda config --show-sources
Saving Settings to your .condarc file
The .condarc file can also be modified via conda commands. Below are several examples of how to do this.
To add a new value, such as http://conda.anaconda.org/mutirri, to a specific key, such as channels:
conda config --add channels http://conda.anaconda.org/mutirri
To remove an existing value, such as http://conda.anaconda.org/mutirri from a specific key, such as channels:
conda config --remove channels http://conda.anaconda.org/mutirri
To remove a key, such as channels, and all of its values:
conda config --remove-key channels
To configure channels and their priority for a single environment, make a
.condarc
file in the root directory of that environment.
Sample .condarc file
Because the .condarc
file is just a YAML file, it means that it can be
edited directly. Below is an example .condarc
file:
Figure 8-30 Sample.condarc file
