Skip to main content

Environment Commands

The environment is Conda's core. This section covers creating, activating, deactivating and removing environments.

Create an environment​

Create myenv with Python 3.11:

Linux / macOS
conda create -n myenv python=3.11

Create from a file (see Export / Import):

Linux / macOS
conda env create -f environment.yml

List environments​

* marks the active environment:

Linux / macOS
conda env list
# or
conda info --envs

Activate / deactivate​

Linux / macOS
conda activate myenv # enter env
conda deactivate # leave current env, back to base

💡 If conda activate says command not found, run source ~/miniconda3/etc/profile.d/conda.sh first, or ensure conda init ran at install.

Remove an environment​

Linux / macOS
conda env remove -n oldenv -y

Clone an environment​

Linux / macOS
conda create -n myenv-copy --clone myenv
tip

Daily triage three-liner

Linux / macOS
conda env list # 1. which envs / which is active
conda list # 2. what's installed in current env
conda info # 3. Conda root path and channel config
Join Us