While using Anaconda with a fixed size home space, a user may encounter the following error
CondaError: OSError(122, 'Disk quota exceeded'
In some cases it is useful to change the package cache and/or the envs directories from the default locations. The default locations, for Windows and OS X/Linux respectively, are:
- C:\Users\User\.conda\envs
- C:\Users\User\.conda\pkgs
- /Users/User/.conda/envs
- /Users/User/.conda/pkgs
envs_dirs
In your .condarc
file you can specify directories in which environments are located by defining the envs_dir
variable.
EXAMPLE .condarc:
envs_dirs:
- ~/my-envs
- /opt/anaconda/envs
The envs_dir key also determines where the package caches are located. However, the CONDA_ENVS_PATH
environment variable overwrites this setting. You can set the CONDA_ENVS_PATH
the following ways:
- For macOS and Linux:
CONDA_ENVS_PATH=~/my-envs:/opt/anaconda/envs
- For Windows:
set CONDA_ENVS_PATH=C:\Users\joe\envs;C:\Anaconda\envs
pkgs_dirs
In your .condarc
file you can specify directories in which packages are located.
EXAMPLE .condarc:
pkgs_dirs:
- /opt/anaconda/pkgs
The pkgs_dirs
key will have no effect on where the envs are stored.
CONDA_PKGS_DIRS
environment variable overwrites this setting. You can set the CONDA_PKGS_DIRS
the following ways:
- For macOS and Linux:
CONDA_PKGS_DIRS=/opt/anaconda/pkgs
- For Windows:
set CONDA_PKGS_DIRS=C:\Anaconda\pkgs
envs_dirs
is set in your .condarc
file conda may use the first directory it can write to, this is typically the default in ~/.conda/
. When trying to change the default cache directory it may be necessary to set the default location /User/home/.conda/pkgs/
to read-only in order to prevent conda from using this location.