conda
Conda 24+Quick reference for Conda CLI commands: environment management, package install / search, channels, lockfiles, configuration, and cleanup — with common options and practical examples.
40 commands
Help
conda --versionPrint the conda version, release date, and Python interpreter in use.
conda --versionconda infoShow platform, Python version, environment directories, channel URLs, and configured package cache.
--envs; --json; --all
conda info --envsconda helpList every conda subcommand.
conda helpconda help <subcommand>Show the full flag list and description for one subcommand.
conda help installUpdate
conda update condaUpdate conda itself to the latest version on the current channel.
-n <env>; --all
conda update condaconda update --allUpdate every package in the current environment to the newest available version.
-n <env>; --no-pin; --strict-channel-priority
conda update --allEnvironment
conda create -n <name>Create a new empty environment named `<name>` (default Python version from the base interpreter).
python=<ver>; -y yes to prompts; --clone <env>; --file <env.yml>; -p <path>
conda create -n py-data python=3.12 -yconda create -n <name> python=<ver>Create an environment pinned to a specific Python version.
conda create -n py311 python=3.11 -yconda env create -f <env.yml>Create an environment from a YAML spec file — the most reproducible way to share environments.
-n <name>; -p <path>; --prune; --json
conda env create -f environment.ymlconda env update -f <env.yml> --pruneUpdate an existing environment from a YAML spec file; `--prune` removes packages no longer listed.
conda env update -f environment.yml --pruneconda env export > environment.ymlExport the current environment to a YAML file (no build strings by default — use `--no-builds` for cross-platform portability).
--no-builds; --from-history; --json; --channel-priority strict
conda env export --from-history > environment.ymlconda activate <name>Activate an environment by name (or path with `conda activate <path>`). On Windows use `activate <name>` from cmd.exe.
<name>; <path>
conda activate py-dataconda deactivateExit the current environment and return to the base.
conda deactivateconda env listList every conda environment with its location. The current env is highlighted with `*`.
-v paths under `~/.conda/envs`; --json
conda env listconda env remove -n <name>Delete an environment entirely.
-n <name>; -p <path>; --all; -y
conda env remove -n old-proj -yconda env config vars set VAR=valueSet an environment variable that's auto-applied whenever the env is activated.
-n <name>; -p <path>
conda env config vars set -n py-data CUDA_VISIBLE_DEVICES=0conda rename -n <old> <new>Rename an environment (clones to a new name and removes the old one).
-n <old> <new>; -p <path> <new_path>; -d dry-run
conda rename -n py-data py-mlPackages
conda install <pkg>Install a package into the active (or `-n` named) environment.
-n <env>; -p <path>; -c <channel>; -y; --update-deps; --force-reinstall; --no-deps
conda install -n py-data numpy pandasconda install -c conda-forge <pkg>Install from the conda-forge community channel (broader catalogue than the default channel).
conda install -c conda-forge nodejsconda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidiaInstall PyTorch with GPU support from the PyTorch channel.
conda install pytorch-cuda=12.1 -c pytorch -c nvidiaconda install --file <requirements.txt>Install every package listed in a `pip`-compatible requirements file via conda.
conda install --file requirements.txtconda search <pkg>Search the configured channels for a package; show version, build string, and channel.
-c <channel>; --info show package details; --platform; --json
conda search 'numpy>=2.0'conda listList every package installed in the active environment with build + channel.
-n <env>; -p <path>; --json; --export; --revisions show history
conda list --export > pkglist.txtconda list --revisionsShow the history of `install / update / remove` actions — pair with `conda install --revision <N>` to roll back.
conda list --revisionsconda install --revision <N>Roll the environment back to revision `<N>` (see `conda list --revisions`).
conda install --revision 3conda remove <pkg>Uninstall a package and its dependencies that are no longer needed.
-n <env>; -p <path>; -y; --all; --force
conda remove -n py-data scipy -yChannels
conda config --add channels <ch>Add a channel to `.condarc` (highest-priority last by default — reverse with `--prepend`).
-c <channel>; --prepend; --force
conda config --add channels conda-forge --prependconda config --remove channels <ch>Remove a channel from `.condarc`.
conda config --remove channels conda-forgeconda config --show channelsPrint the current channel priority list.
--json; --system; --env
conda config --show channelsconda config --set channel_priority strict|flex|disabledControl how channels resolve conflicts. `strict` (default since Conda 23) = highest-priority channel wins entirely.
conda config --set channel_priority strictConfiguration
conda config --showPrint the merged configuration: ~/.condarc + system + env-scoped + CLI overrides.
--all; --json; --source; -v
conda config --show | grep -i sslconda config --set <key> <value>Set a configuration key (anything you'd write in `.condarc`).
conda config --set auto_activate_base falseconda config --describe <key>Show every allowed value and the default for a config key.
conda config --describe channel_priorityconda config --write-defaultWrite the default `.condarc` to the user home (overwriting without prompt).
conda config --write-defaultCache / Cleanup
conda clean --allRemove tarballs, cached packages, lockfiles, and index cache to reclaim disk space.
-y; --packages; --index-cache; --tarballs; --locks; --source-cache
conda clean --all -yconda clean --packagesRemove cached `.tar.bz2` / `.conda` archives (saves significant disk space).
conda clean --packages -yconda clean --index-cacheRemove the cached channel index. The next command will re-download the index.
conda clean --index-cache -yBuild
conda build <recipe>Build a conda package from a recipe directory (skeleton: conda skeleton pypi <name>).
<recipe>; --no-test; --no-build-id; -c <channel>; --output
conda build recipes/numpyMisc
conda run -n <env> <cmd>Run a command inside an environment without activating it — useful in CI scripts and cron jobs.
-n <env>; -p <path>; --cwd <dir>
conda run -n py-data pytest -xconda doctorDiagnose common issues: inconsistent env state, channel priority, lock files, etc.
-n <env>; --verbose; --fix-checks
conda doctorRelated command cheatsheets
uv
Quick reference for the uv CLI: Python project init, dependency management, virtual environments, lockfile resolution, tool runners, and self-update — with common options and practical examples.
39 commands
uv 0.4+
pip
Quick reference for the pip package installer CLI: install / uninstall / inspect packages, virtual environments, requirements files, configuration, and index management — with common options and practical examples.
37 commands
pip 24+
pytest
Quick reference for the pytest CLI: test discovery, selection, fixtures, markers, parallelism, parametrize, and coverage integration — with common options and practical examples.
34 commands
pytest 8+
Trademark & Use Notice
These command-line tool cheatsheets are open community references. The names, logos, and trademarks of the tools referenced here (such as Git™, Docker™, Kubernetes®, kubectl, PostgreSQL®, MySQL®, Redis™, MongoDB®, Linux™, PowerShell™, Vim™, and others) are the property of their respective owners and are used here solely for identification and reference purposes.
All content in these cheatsheets is independently authored as a simplified, self-contained reference. It is not affiliated with, endorsed by, or sourced from any official documentation. Command listings, flag descriptions, and examples are original simplifications; for authoritative information please consult the official documentation of each tool.
Command syntax and option flags may differ across tool versions. The version tags shown reflect stable releases; behavior may differ in other versions. This cheatsheet does not imply any preference or recommendation by the trademark holders.
If a trademark or copyright owner believes that any content on this site infringes their rights, please send an email to [email protected]. Upon receiving valid proof of rights, we will modify or remove the relevant content within a reasonable period.
This website assumes no legal liability for any direct or indirect losses arising from the use of information presented on these pages.
About Conda
Conda is an open-source package and environment manager that first shipped in 2012 by Continuum Analytics (now Anaconda Inc). Conda was created for the Python data-science stack because pip + virtualenv couldn't install scientific libraries like NumPy, SciPy, scikit-learn, or PyTorch in a self-contained way — those packages bundle compiled C / Fortran / CUDA binaries that pip couldn't reliably resolve. Conda distributes pre-built packages for Python, R, Lua, Ruby, and most other language runtimes, and installs them into isolated environments. The current stable line is Conda 24+. The newer libmamba solver (`conda-libmamba-solver`, default since Conda 23.10) re-implements dependency resolution on top of the mamba C++ library, dropping resolution times from minutes to milliseconds. Common sibling tools include `mamba` (drop-in CLI replacement), `micromamba` (a single-binary installer used in CI / Docker), and `pixi` (next-generation Rust-based conda + lockfile manager). Conda is GPLv3-licensed; the Anaconda distribution adds a commercial tier for large organisations. By default Conda downloads from `repo.anaconda.com` and other configured channels; it does not upload your code.
Cheatsheet version 1.0.0