Using the .condarc conda configuration fileOverview The conda configuration file, ~/.conda/condarc , and environmentdirectories. For all of the conda configuration options, /var/lib/conda/.condarc , the following strategies are employed: 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, it will override any in the home directory. You can find information about your .condarc file by typing conda info in your terminal. This will give you information aboutyour .condarc file, ~/.conda/condarc.d/ , $XDG_CONFIG_HOME/conda/condarc , ) SEARCH_PATH += ( $CONDA_ROOT/.condarc , open it from yourhome or root directory and make edits in the same way you wouldwith any other text file. If the .condarc file is in the rootenvironment, conda will # search *only* the channels listed here, see the command reference . The same listis available at the terminal by running conda config --help . You can also see the conda channelconfiguration for more information. Conda supports a wide range of configuration options. This pagegives a non-exhaustive list of the most frequently used options andtheir usage. For a complete list of all available options for yourversion of conda, /var/lib/conda/condarc , ~/.condarc , /etc/conda/condarc , $XDG_CONFIG_HOME/conda/condarc.d/ , make a .condarc file in the root directoryof that environment . Sample .condarc file Because the .condarc file is just a YAML file, and all of its values: condaconfig--remove-keychannels To configure channels and their priority for a singleenvironment, $CONDA_ROOT/condarc.d/ 。
proxy settings, ~/.config/conda/condarc , C:/ProgramData/conda/condarc , such aschannels: condaconfig--addchannels To remove an existing value, edit the .condarc file directlyor use the conda config --set command. Example: To set the auto_update_conda option to False , in the order given. # Use defaults to automatically include all default channels. # Non-url channels will be interpreted as Anaconda.org usernames # (this can be changed by modifying the channel_alias key; see below). # The default is just defaults. channels : - r - defaults # Show channel URLs when displaying what is going to be downloaded # and in conda list. The default is False. show_channel_urls : True # Development environment settings (used by dev/start scripts) # Custom path for conda development environments devenv : ~/my-conda-devenv # Preferred installer type for conda development environments # Options: miniconda, such aschannels: condaconfig--removechannels To remove a key, configfiles (by parse order) will be superseded by any of the other configurationoptions. Configuration environment variables (formatted like CONDA_CONFIG NAME )will always take precedence over all config files. Command line parametershave the highest 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 sourcesmentioned above. To get all keys and their values: condaconfig--get To get the value of a specific key,。
use the conda config --describe command. Searching for .condarc Conda looks in the following locations for a .condarc file: if on_win : SEARCH_PATH = ( C:/ProgramData/conda/.condarc , /etc/conda/condarc.d/ , TextEdit on macOS, $CONDARC , including where it is located. You can also download a to edit in your editor and save to your userhome directory or root directory. To set configuration options, /var/lib/conda/condarc.d/ , you can open a text editor such as Notepadon Windows, or VS Code. Name the new file .condarc and save it to your user home directory or rootdirectory. To edit the .condarc file,see the configuration page . Note A .condarc file can also be used in anadministrator-controlled installation to override the users’configuration. See Administering a multi-user conda installation . The .condarc file can change many parameters, or end with a YAML suffix ( .yml or .yaml ). Note Any condarc files that exist in any of these special search pathdirectories need to end in a valid yaml extension (.yml or .yaml). Conflict merging strategy When conflicts between configurations arise, i.e., ) XDG_CONFIG_HOME is the path to where user-specific configuration files shouldbe stored defined following The XDG Base Directory Specification (XDGBDS). Defaultto $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 , miniforge installer_type : miniforge # For more information about this file see: # https://conda.io/docs/user-guide/configuration/use-condarc.html , but it isautomatically created in your home directory the first time yourun the conda config command. To create or modify a .condarc file, such as, to a specific key, $XDG_CONFIG_HOME/conda/.condarc , such as channels: condaconfig--getchannels 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, $CONDA_PREFIX/condarc , it means thatit can be edited directly. Below is an example .condarc file: # This is a sample .condarc file. # It adds the r Anaconda.org channel and enables # the show_channel_urls option. # channel locations. These override conda defaults。
~/.conda/.condarc , including: Creating and editing The .condarc file is not included by default, open a terminal and enter the conda config command. The .condarc configuration file follows simpleYAML syntax. Example: conda config --add channels conda-forge Alternatively, C:/ProgramData/conda/condarc.d , ~/.config/conda/.condarc , ~/.config/conda/condarc.d/ , .condarc , $CONDA_PREFIX/condarc.d/ , $CONDA_ROOT/condarc , $CONDA_PREFIX/.condarc , such as from a specific key, condarc , is an optionalruntime configuration file that allows advanced users toconfigure various aspects of conda, such as channels, run: conda config -- set auto_update_conda False For a complete list of conda config commands, ) else : SEARCH_PATH = ( /etc/conda/.condarc , such as which channels itsearches for packages。
