Using The .Condarc Conda Configuration File
Using The .Condarc Conda Configuration File
Using The .Condarc Conda Configuration File
html
Docs » User guide » Configuration » Using the .condarc conda configuration file
Overview
The conda configuration file, .condarc , is an optional runtime configuration file that allows
advanced users to configure various aspects of conda, such as which channels it searches for
packages, proxy settings and environment directories.
1 of 13 11/20/18, 6:08 PM
Theconda
Using the .condarc file isfilenot
configuration
.condarc included
— Conda by default,
documentation but it is automatically created in your home directory
https://conda.io/docs/user-guide/configuration/use-condarc.html
A .condarc file may also be located in the root environment, in which case it overrides any in the
home directory.
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.
To create or modify a .condarc file, use the conda config command or use a text editor to create
a new file named .condarc and save it to your user home directory or root directory.
EXAMPLE:
You can also download a sample .condarc file to edit in your editor and save to your user home
directory or root directory.
To set configuration options, edit the .condarc file directly or use the conda config --set
command.
For a complete list of conda config commands, see the command reference <../../commands
/conda-config>. The same list is available at the Terminal or Anaconda Prompt by running
conda config --help .
TIP: Conda supports tab completion with external packages instead of internal configuration.
General configuration
Channel locations (channels)
2 of 13 11/20/18, 6:08 PM
Listing
Using the .condarc channel
conda locations
configuration in the
file — Conda documentation
.condarc file overrides condahttps://conda.io/docs/user-guide/configuration/use-condarc.html
defaults, causing conda to search
only the channels listed here, in the order given.
Use defaults to automatically include all default channels. Non-URL channels are interpreted as
Anaconda.org user names. You can change this by modifying the channel_alias as described in
Set a channel alias (channel_alias). The default is just defaults .
EXAMPLE:
channels:
- <anaconda_dot_org_username>
- http://some.custom/channel
- file:///some/local/directory
- defaults
To select channels for a single environment, put a .condarc file in the root directory of that
environment (or use the --env option when using conda config ).
EXAMPLE: If you have installed Miniconda with Python 3 in your home directory and the
environment is named “flowers”, the path may be:
~/miniconda3/envs/flowers/.condarc
The system-level .condarc file may specify a set of allowed channels, and it may allow users to
install packages from other channels with the boolean flag allow_other_channels. The default is
True .
If allow_other_channels is set to False , only those channels explicitly specified in the system
.condarc file are allowed:
allow_other_channels: False
When allow_other_channels is set to True or not specified, each user has access to the default
channels and to any channels that the user specifies in their local .condarc file. When
allow_other_channels is set to false , if the user specifies other channels, the other channels are
blocked, and the user receives a message reporting that channels are blocked. For more
information, see Example administrator-controlled installation.
If the system .condarc file specifies a channel_alias, it overrides any channel aliases set in a
user’s .condarc file. See Set a channel alias (channel_alias).
Normally the defaults channel points to several channels at the repo.continuum.io repository, but if
default_channels is defined, it sets the new list of default channels. This is especially useful for air
3 of 13 11/20/18, 6:08 PM
gapconda
Using the .condarc and configuration
enterprise file
installations:
— Conda documentation https://conda.io/docs/user-guide/configuration/use-condarc.html
default_channels:
- <anaconda_dot_org_username>
- http://some.custom/channel
- file:///some/local/directory
When True , conda updates itself any time a user updates or installs a package in the root
environment. When False , conda updates itself only if the user manually issues a conda update
EXAMPLE:
auto_update_conda: False
Choose the yes option whenever asked to proceed, such as when installing. Same as using the
--yes flag at the command line. The default is False .
EXAMPLE:
always_yes: True
Show channel URLs when displaying what is going to be downloaded and in conda list . The
default is False .
EXAMPLE:
show_channel_urls: True
When using activate , change the command prompt from $PS1 to include the activated
environment. The default is True .
EXAMPLE:
changeps1: False
4 of 13 11/20/18, 6:08 PM
Add pip as Python dependency (add_pip_as_python_dependency)
Using the .condarc conda configuration file — Conda documentation
https://conda.io/docs/user-guide/configuration/use-condarc.html
Add pip, wheel and setuptools as dependencies of Python. This ensures that pip, wheel and
setuptools are always installed any time Python is installed. The default is True .
EXAMPLE:
add_pip_as_python_dependency: False
Use pip when listing packages with conda list . This does not affect any conda command or
functionality other than the output of the command conda list . The default is True .
EXAMPLE:
use_pip: False
By default, proxy settings are pulled from the HTTP_PROXY and HTTPS_PROXY environment
variables or the system. Setting them here overrides that default:
proxy_servers:
http: http://user:[email protected]:8080
https: https://user:[email protected]:8080
To give a proxy for a specific scheme and host, use the scheme://hostname form for the key. This
matches for any request to the given scheme and exact host name:
proxy_servers:
'http://10.20.1.128': 'http://10.10.1.10:5323'
If you do not include the user name and password or if authentication fails, conda prompts for a
user name and password.
If your password contains special characters, you need escape them as described in Percent-
encoding reserved characters , on Wikipedia.
Be careful not to use http when you mean https or https when you mean http.
If you are behind a proxy that does SSL inspection such as a Cisco IronPort Web Security
Appliance (WSA), you may need to use ssl_verify to override the SSL verification settings.
5 of 13 11/20/18, 6:08 PM
By default
Using the .condarc this variable
conda configuration file —is
Conda
True , which means
documentation that SSL verification is used and conda verifies
https://conda.io/docs/user-guide/configuration/use-condarc.html
certificates for SSL connections. Setting this variable to False disables the connection’s normal
security and is not recommended:
ssl_verify: False
You can also set ssl_verify to a string path to a certificate, which can be used to verify SSL
connections:
ssl_verify: corp.crt
Filters out all channel URLs that do not use the file:// protocol. The default is False .
EXAMPLE:
offline: True
Advanced configuration
Disallow soft-linking (allow_softlinks)
When allow_softlinks is True , conda uses hard-links when possible and soft-links—symlinks—
when hard-links are not possible, such as when installing on a different file system than the one
that the package cache is on.
When allow_softlinks is False , conda still uses hard-links when possible, but when it is not
possible, conda copies files. Individual packages can override this option, specifying that certain
files should never be soft-linked. See No link.
EXAMPLE:
allow_softlinks: False
Whenever you use the -c or --channel flag to give conda a channel name that is not a URL,
conda prepends the channel_alias to the name that it was given. The default channel_alias is
https://conda.anaconda.org/.
6 of 13 11/20/18, 6:08 PM
Using the .condarc conda configuration file — Conda documentation https://conda.io/docs/user-guide/configuration/use-condarc.html
conda install --channel asmeurer <package>
channel_alias: https://your.repo/
On Windows, you must include a slash (“/”) at the end of the URL:
EXAMPLE: https://your.repo/conda/
When creating new environments, add the specified packages by default. The default packages
are installed in every environment you create. You can override this option at the command
prompt with the --no-default-packages flag. The default is to not include any packages.
EXAMPLE:
create_default_packages:
- pip
- ipython
- scipy=0.15.0
Enable certain features to be tracked by default. The default is to not track any features. This is
similar to adding mkl to the create_default_packages list.
EXAMPLE:
7 of 13 11/20/18, 6:08 PM
Using the .condarc conda configuration file — Conda documentation https://conda.io/docs/user-guide/configuration/use-condarc.html
track_features:
- mkl
By default, conda install updates the given package to the latest version, and installs any
dependencies necessary for that package. However if dependencies that satisfy the package’s
requirements are already installed, conda will not update those packages to the latest version.
In this case, if you would prefer that conda update all dependencies to the latest version that is
compatible with the environment, set update_dependencies to True :
update_dependencies: False
NOTE: Conda still ensures that dependency specifications are satisfied. Thus, some
dependencies may still be updated or, conversely, this may prevent packages given at the
command line from being updated to their latest versions. You can always specify versions at the
command line to force conda to install a given version, such as conda install numpy=1.9.3 .
To avoid updating only specific packages in an environment, a better option may be to pin them.
For more information, see Preventing packages from updating (pinning).
Disallow the installation of certain packages. The default is to allow installation of all packages.
EXAMPLE:
disallow:
- anaconda
When the channel alias is Anaconda.org or an Anaconda Server GUI, you can set the system
configuration so that users automatically see private packages. Anaconda.org was formerly known
as binstar.org. This uses the Anaconda command-line client, which you can install with
conda install anaconda-client , to automatically add the token to the channel URLs.
EXAMPLE:
add_anaconda_token: False
8 of 13 NOTE: Even when set to True , this setting is enabled only if the Anaconda command-line client11/20/18, 6:08 PM
is installed
Using the .condarc and you file
conda configuration are— logged in with the
Conda documentation anaconda login command.
https://conda.io/docs/user-guide/configuration/use-condarc.html
Specify directories in which environments are located. If this key is set, the root prefix envs_dir is
not used unless explicitly included. This key also determines where the package caches are
located.
For each envs here, envs/pkgs is used as the pkgs cache, except for the standard envs
directory in the root directory, for which the normal root_dir/pkgs is used.
EXAMPLE:
envs_dirs:
- ~/my-envs
- /opt/anaconda/envs
Specify directories in which packages are located. If this key is set, the root prefix pkgs_dirs is
not used unless explicitly included.
EXAMPLE:
pkgs_dirs:
- /opt/anaconda/pkgs
Build output root directory. You can also set this with the CONDA_BLD_PATH environment
variable. The default is <CONDA_PREFIX>/conda-bld/ . If you do not have write permissions to
<CONDA_PREFIX>/conda-bld/ , the default is ~/conda-bld/ .
EXAMPLE:
9 of 13 11/20/18, 6:08 PM
Using the .condarc conda configuration file — Conda documentation https://conda.io/docs/user-guide/configuration/use-condarc.html
conda-build:
root-dir: ~/conda-builds
Automatically upload packages built with conda build to Anaconda.org. The default is False .
EXAMPLE:
anaconda_upload: True
Tokens are a means of authenticating with anaconda.org without logging in. You can pass your
token to conda-build with this condarc setting, or with a CLI argument. This is unset by default.
Setting it implicitly enables anaconda_upload.
conda-build:
anaconda_token: gobbledygook
Conda-build’s output verbosity can be reduced with the quiet setting. For more verbosity use the
CLI flag --debug .
conda-build:
quiet: true
conda-build:
filename_hashing: false
NOTE: conda-build does no checking when clobbering packages. If you utilize conda-build 3’s
build matrices with a build configuration that is not reflected in the build string, packages will be
missing due to clobbering.
By default, conda-build uses conda-verify to ensure that your recipe and package meet some
10 of 13 11/20/18, 6:08 PM
minimum
Using the .condarc sanity checks.
conda configuration You can
file — Conda disable these:
documentation https://conda.io/docs/user-guide/configuration/use-condarc.html
conda-build:
no_verify: true
By default, conda-build creates a new folder for each build, named for the package name plus a
timestamp. This allows you to do multiple builds at once. If you have issues with long paths, you
may need to disable this behavior. You should first try to change the build output root directory
with the root-dir setting described above, but fall back to this as necessary:
conda-build:
set_build_id: false
By default, conda-build builds all recipes that you specify. You can instead skip recipes that are
already built. A recipe is skipped if and only if all of its outputs are available on your currently
configured channels.
conda-build:
skip_existing: true
By default, conda-build includes the recipe that was used to build the package. If this contains
sensitive or proprietary information, you can omit the recipe.
conda-build:
include_recipe: false
NOTE: If you do not include the recipe, you cannot use conda-build to test the package after the
build completes. This means that you cannot split your build and test steps across two distinct CLI
commands ( conda build --notest recipe and conda build -t recipe ). If you need to omit the
recipe and split your steps, your only option is to remove the recipe files from the tarball artifacts
after your test step. Conda-build does not provide tools for doing that.
By default, conda-build activates the build and test environments prior to executing the build or
test scripts. This adds necessary PATH entries, and also runs any activate.d scripts you may
have. If you disable activation, the PATH will still be modified, but the activate.d scripts will not run.
This is not recommended, but some people prefer this.
11 of 13 11/20/18, 6:08 PM
Using the .condarc conda configuration file — Conda documentation https://conda.io/docs/user-guide/configuration/use-condarc.html
conda-build:
activate: false
Unset by default. If you have wheel outputs in your recipe, conda-build will try to upload them to
the PyPI repository specified by the pypi_repository setting using credentials from this file path.
conda-build:
pypirc: ~/.pypirc
Unset by default. If you have wheel outputs in your recipe, conda-build will try to upload them to
this PyPI repository using credentials from the file specified by the pypirc setting.
conda-build:
pypi_repository: pypi
12 of 13 11/20/18, 6:08 PM
To remove
Using the .condarc a key, such
conda configuration file —as channels,
Conda and all
documentation of its values: https://conda.io/docs/user-guide/configuration/use-condarc.html
To configure channels and their priority for a single environment, make a .condarc file in the root
directory of that environment.
13 of 13 11/20/18, 6:08 PM