Environment variables#
Environment variables that conda-exec reads, sets, or respects during operation.
conda-exec variables#
CONDA_EXEC_HOMEOverride the base data directory for cached environments. Default:
~/.conda/exec/. The value is expanded with~support and resolved to an absolute path. When set, all cached environments are stored under$CONDA_EXEC_HOME/envs/instead of~/.conda/exec/envs/. Useful for testing or placing the cache on a different filesystem.export CONDA_EXEC_HOME=/scratch/conda-exec conda exec ruff check . # Environment stored at /scratch/conda-exec/envs/ruff--<hash>/
CONDA_EXEC_AUTO_CLEANEnable or disable automatic cache cleanup after successful tool runs. Default:
true. Accepted truthy values are1,true,yes, andon; accepted falsy values are0,false,no, andoff.export CONDA_EXEC_AUTO_CLEAN=false
CONDA_EXEC_CLEAN_INTERVALNumber of successful
conda exec TOOLruns between automatic cleanup checks. Default:50. Values must be positive integers.export CONDA_EXEC_CLEAN_INTERVAL=25
CONDA_EXEC_CLEAN_AGERemove cached environments that have not been used in this many days when automatic cleanup runs. Default:
30. Values must be zero or greater.export CONDA_EXEC_CLEAN_AGE=14
conda plugin settings#
Automatic cleanup can also be configured persistently through conda’s
plugin configuration in
.condarc:
plugins:
conda_exec_auto_clean: true
conda_exec_clean_interval: 50
conda_exec_clean_age: 30
The direct CONDA_EXEC_* variables above override these plugin settings.
conda’s standard plugin environment variable form is also supported, for
example CONDA_PLUGINS_CONDA_EXEC_AUTO_CLEAN=false.
Variables set during tool execution#
PATHModified before the tool process starts. The behavior depends on the
--activateflag:Without
--activate(default): the prefix’sbin/directory (orScripts/on Windows) is prepended toPATH. No other environment variables are changed.With
--activate: conda’s activator computes the subprocess environment, which modifiesPATHand may set or unset additional variables (seeCONDA_PREFIXbelow).
CONDA_PREFIXOnly set when
--activateis used. Points to the ephemeral environment prefix (e.g.~/.conda/exec/envs/samtools--7e2d9f04/). Without--activate, this variable is not set.
Standard conda variables#
conda-exec runs within conda’s plugin framework and inherits conda’s
context system.
The following standard conda environment variables are respected through
conda.base.context.context:
CONDA_ALWAYS_YESWhen set to
true, skip confirmation prompts (equivalent to--yeson the command line). Applies toconda exec --clean.CONDA_DRY_RUNWhen set to
true, report what would be done without making changes. Applies toconda exec --clean.CONDA_SUBDIROverride the platform subdirectory used for package resolution (e.g.
linux-64,osx-arm64). Passed through to the solver.
Note
Use conda exec --list --json for conda-exec’s machine-readable cache
listing. The list command is not currently controlled by conda’s global
CONDA_JSON setting.
Path resolution order#
The base data directory is resolved in this order:
CONDA_EXEC_HOMEenvironment variable, if set~/.conda/exec/(primary location on all platforms)On Windows only, if
~/.conda/exec/does not exist:platformdirs.user_data_dir("conda", "conda") / "exec"as a fallback matching conda’s own data directory conventions