Practical Conda Command-Line Reference for Environment and Package Management

Core Utilities and System Updates

Verify the installed distribution version and synchronize dependencies before proceeding.

conda --version
conda update conda
conda update --all

Virtual Environment Lifecycel

Isolate project dependencies using distinct environments. Create, replicate, inspect, or discard them as needed.

Initialization & Cloning Provision a fresh workspace targeting a specific interpreter and initial dependencies:

conda create -n data_lab python=3.9 numpy pandas scikit-learn

Duplicate an existing configuration without manual reconfiguration:

conda create -n prod_mirror --clone legacy_prod

Inspection & Termination Enumerate available targets and permanently destroy a workspace:

conda env list
# OR conda info -e
conda env remove -n legacy_prod
# Alternative deletion syntax: conda remove -n legacy_prod --all

Cross-Platform Session Control

Switch contexts between isolated runtimes. Syntax varies by operating system.

Activating

# POSIX-compliant systems (Linux, macOS)
conda activate data_lab
source activate data_lab

# Windows CMD/PowerShell
conda activate data_lab
activate data_lab

Deactivating Revert to the base or default shell context:

conda deactivate

Repository Operations

Manage third-party libraries within targeted namespaces. If no namespace flag is applied, operations target the active runtime.

Discovery & Installation Query available distributions and deploy specified modules:

conda search matplotlib
conda install -n ml_research matplotlib seaborn

Listing Dependencies Audit currently resolved artifacts inside the current session:

conda list

Or inspect a specific snapshot:

conda list -n ml_research

Uninstallation Strip unneeded components from the active or designated environment:

conda remove matplotlib
# Targeted removal
conda remove -n legacy_prod numpy

Targeted Runtime Configuration Example

Establish separated workspaces for machine learning inference with varying hardware requirements:

# CPU-only execution path
conda create -n tf_cpu tensorflow
conda activate tf_cpu

# Hardware-accelerated execution path
conda create -n tf_gpu tensorflow-gpu cudatoolkit=11.2
conda activate tf_gpu

Tags: conda anaconda python environment-management package-management

Posted on Fri, 08 May 2026 20:38:53 +0000 by niesom