Conda Quick Reference

Overview

Conda is an open-source package management system and environment management system that runs on Windows, macOS, and Linux. It was created for Python programs, but it can package and distribute software for any language (R, Ruby, Lua, Scala, Java, JavaScript, C/ C++, FORTRAN).

Anaconda is a free and open-source distribution of Python and R programming languages for data science and machine learning related applications. It aims to simplify package management and deployment. It comes pre-loaded with many popular packages, and includes Conda as the default package manager.

Miniconda, on the other hand, is a minimal installer for Conda. It includes only Conda, Python, the packages they depend on, and a small number of other useful packages. This makes Miniconda a lighter-weight base to start from if you’re only interested in using Conda for package management and not the larger suite of tools and applications included in Anaconda.

Basic Conda Commands

Here are the basic commands you need to use conda:

Check Version

Check the version of conda installed.

conda --version

Update Conda

Update conda to the latest version.

conda update conda

Search for a Package

Search for a package to see if it’s available to install via conda.

conda search package_name

Install a Package

Install a specific package. Replace `package_name` with the name of the package you want to install.

conda install package_name

List Installed Packages

List all packages installed in the active conda environment.

conda list

Remove a Package

Remove an installed package. Replace `package_name` with the name of the package you want to remove.

conda remove package_name

Update a Package

Update a specific package to the latest version.

conda update package_name

Environment Management

One of the most powerful features of Conda is the ability to manage environments.

Create a New Environment

Create a new environment. Replace `env_name` with the name you want to give to the new environment.

conda create --name env_name

Create a New Environment with a Specific Package

Create a new environment and install a specific package at the same time.

conda create --name env_name package_name

List Environments

List all of the Conda environments on your machine.

conda env list

Activate an Environment

Activate a specific environment. Replace `env_name` with the name of the environment you want to activate.

conda activate env_name

Deactivate the Current Environment

Deactivate the currently active environment.

conda deactivate

Remove an Environment

Remove a specific environment.

conda env remove --name env_name

Remember that Conda is a powerful tool with many more features and options than those listed here. This guide should serve as a good starting point for the most common tasks you’ll perform with Conda.