Skip to main content
This guide will help you get started with Conda’s core functionality: managing packages and creating environments.

Basic Package Management

Conda makes it easy to view, search, and install packages.

Listing Installed Packages

If you installed the Anaconda Distribution, you will already have hundreds of packages installed. You can see what packages are installed by running:
$ conda list
This displays all packages currently installed in your active environment.

Searching for Packages

To see all the packages that are available:
$ conda search
To search for a specific package:
$ conda search numpy

Installing Packages

To install a package, use:
$ conda install <package-name>
For example, to install NumPy:
$ conda install numpy

Working with Environments

The real power of conda comes from its ability to manage environments. In conda, an environment can be thought of as a completely separate installation.

Why Use Environments?

Conda installs packages into environments efficiently using hard links by default when it is possible, so environments are space efficient, and take seconds to create. Environments allow you to:
  • Isolate project dependencies
  • Use different versions of packages for different projects
  • Avoid conflicts between package requirements
  • Easily share reproducible environments

Understanding the Base Environment

The default environment, which conda itself is installed into, is called base. This is the environment you’re using when you first open a terminal after installing Conda.

Creating Your First Environment

Let’s create a new environment for a machine learning project.
1

Create the environment

To create an environment with PyTorch, run:
$ conda create --name ml-project pytorch
This creates an environment called ml-project with the latest version of PyTorch and its dependencies.
You can create an environment with multiple packages at once by listing them:
$ conda create --name my-env python=3.11 numpy pandas matplotlib
2

Activate the environment

Once the environment is created, activate it:
$ conda activate ml-project
This puts the bin directory of the ml-project environment in the front of the PATH, and sets it as the default environment for all subsequent conda commands.After activation, your terminal prompt will typically show the environment name:
(ml-project) $
3

Install additional packages (optional)

With the environment activated, you can install additional packages:
$ conda install numpy pandas
These packages will be installed only in the ml-project environment.
4

Deactivate the environment

To go back to the base environment, use:
$ conda deactivate
This returns you to the base environment.

Quick Reference

Here’s a handy reference for the most common Conda commands:
# List installed packages
conda list

# Search for packages
conda search <package-name>

# Install a package
conda install <package-name>

# Update a package
conda update <package-name>

# Remove a package
conda remove <package-name>

Example Workflow

Here’s a typical workflow for starting a new Python project:
1

Create a project-specific environment

$ conda create --name data-analysis python=3.11 pandas matplotlib jupyter
2

Activate the environment

$ conda activate data-analysis
3

Work on your project

With the environment activated, all packages you install and use will be isolated to this project.
4

Deactivate when done

$ conda deactivate

Next Steps

Now that you understand the basics, you can:

Build docs developers (and LLMs) love