The conda configuration file, .condarc is an optional runtime configuration file which allows you to configure various aspects of conda, such as channels it searches for packages, proxy settings, environment directories, etc. In an Enterprise installation of Anaconda or an installation paired with Anaconda Repository, you will need more control over conda .
Read further to know the most common .condarc configurations for these environments.
Channels
A list of channels is searched in order to find and install a package. conda goes through the list from top to bottom, looking for a particular package to get the correct version, and then installs it from the first channel where it finds the package.
EXAMPLE:
channels:
- defaults
- <anaconda_dot_org_username>
- http://some.custom/channel
- file:///some/local/directory
Different formats are used for channels:
- defaults: The default for the anaconda.org channel anaconda, https://conda.anaconda.org/anaconda and https://repo.continuum.io/.
- <anaconda_dot_org_username>: specify the anaconda.org username/channel such as conda-forge or r. By default conda interprets these as https://conda.anaconda.org/conda-forge and https://conda.anaconda.org/r respectively.
NOTE: The behavior for a local URL can be changed. See the Default channel Alias section below. - http://some.custom/channel: Specify the entire URL of the channel such as https://conda.anaconda.org/conda-forge or your own Repository channel http://yoururl.com:port/conda/channel.
- file:///some/local/directory: Use a mounted network drive and specify the path by prepending with file:///.
Proxy Configuration/Firewalls
If you want to specify a proxy server to connect through, it can be added to the proxy_servers section. You can whitelist the default channels, https://repo.continuum.io/ and https://conda.anaconda.org/ with your network administrators.
EXAMPLE:
proxy_servers:
http: http://user:pass@corp.com:8080
https: https://user:pass@corp.com:8080
Conda update
Your Enterprise may not want to update conda to the newest version each time you install a new package or update an existing package. Automatic updating could potentially introduce changes or dependencies that can conflict with your setup.
You can disable automatic updating by adding the following entry to your .condarc file:
auto_update_conda: False
Default Channel Alias
If you have Anaconda Repository, you will most likely want to set your Repository URLs to the default channels. As stated in the Channels section above, conda automatically prepends a URL to a user/channel name. By default this is https://conda.anaconda.org/, which can be changed to your Repository URL.
EXAMPLE:
channel_alias: http://yourrepo.com:port/conda
This will make the channel for testuser, https://conda.anaconda.org/testuser automatically. Also it allows to install from your Repository by just adding the channel name in the .condarc file or by specifying a channel in the command:
conda install -c testuser testpackage
Default Package Cache Directory
You can customize the location of conda package's caches. By default this is where anaconda is installed such as ~/anaconda/pkgs. This can be changed by specifying the path in the pkg_dirs option:
EXAMPLE:
pkgs_dirs:
- /path/to/package_directory
Default Environment Directory
You can customize where conda stores newly created environments. By default this is where anaconda is installed, such as ~/anaconda/envs. This can be changed by specifying the path in the envs_dirs option:
EXAMPLE:
envs_dirs:
- /path/to/environments_driectory
See the configuration changes used by conda with conda info.