In Anaconda Notebooks, a runtime is what powers your code execution. You can think of a runtime as a conda environment connected to a language-specific kernel. Anaconda Notebooks provides several pre-configured runtimes that include the ipykernel package and all the packages from the latest Anaconda Distribution release, giving you immediate access to a comprehensive data science toolkit.

Environments, kernels, and runtimes

What is an environment?

An environment is a folder or directory that contains a specific collection of conda packages and their dependencies.

Working in separate environments allows you to maintain and run packages without interference from other collections of packages. For example, you may require separate conda environments to maintain distinct versions of Python based on distinct package dependencies.

What is a kernel?

A kernel is a programming-language-specific process that interprets your code, runs it, and gives you the results. In Jupyter Notebooks, kernels allow users to run code in cells and receive immediate output. For example, ipykernel enables interactive computing in Python, and r-irkernel enables the same for R.

What is a runtime?

A runtime in Anaconda Notebooks is a conda environment that has been associated with a specific kernel, enabling it to execute code. For an environment to be usable in JupyterLab, it must contain a kernel package (such as ipykernel for Python). Without this kernel association, JupyterLab cannot recognize the environment as an available option for running notebooks.

The default runtimes provided in Anaconda Notebooks come with the ipykernel package already installed, making them immediately available for your Python notebooks.

To add a kernel package to a custom environment and create your own runtime, see creating custom runtimes.

Using default runtimes

Custom runtimes often use large amounts of your limited Anaconda Notebooks storage space. Because of this, Anaconda provides a number of read-only default runtimes that contain all the packages from the latest release of Anaconda Distribution.

The default runtime naming convention is typically anaconda-<YEAR>.<MONTH>-py<PYTHON_VERSION>, which maps to Anaconda Distribution releases:

Environment NameStatusDescription
anaconda-2024.02-py10LiveLatest Anaconda Packages (stable & recommended)
anaconda-ai-2024.04-py10LiveLatest Anaconda Packages + AI Packages
anaconda-01-nvidia-a10LiveLatest Anaconda, AI, + NVIDIA Packages (see GPU Runtimes)

To see a list of available runtimes, enter the following in a notebook cell then click Run:

!conda info --envs

To see a list of packages in your current runtime, enter the following in a notebook cell then click Run:

!conda list

Creating custom runtimes

If you need a specific set of packages that are not included in one of our default runtimes, you can create your own runtime to customize to your needs.

Custom runtimes are stored using your dedicated, persistent Anaconda Notebooks storage. This ensures the custom runtime remains available after your current session ends. Custom runtimes use your personal storage space and can easily get quite large, so only include the packages you need.

To create a new runtime:

  1. Open a terminal from the Launcher, which you can access by clicking the blue plus in the top-left corner.

  2. Create a new runtime by running the following command:

    # Replace <ENV_NAME> with a new name for your environment/ runtime
    # Replace <PACKAGE> with the name of a package you want to install in your environment
    # Replace <KERNEL_PACKAGE> with the appropriate kernel package
    conda create --name <ENV_NAME> <PACKAGE> <KERNEL_PACKAGE>
    
    • To create a Python runtime, replace <KERNEL_PACKAGE> with ipykernel.
    • To create an R runtime, replace <KERNEL_PACKAGE> with r-irkernel.

For more information about creating conda environments, see the official conda docs.

It might take a minute for your runtime to be created and available for use. You might need to close and reopen your active notebook or refresh the browser for your new runtime to appear.

Activating a runtime

There are a few locations from which you can activate your runtime:

Run the following in a terminal in Anaconda Notebooks:

# Replace <ENV_NAME> with the name of your environment/ runtime

conda activate <ENV_NAME>

Installing additional packages

Even after you’ve created a runtime, you can continue to add packages as needed. To add packages to a runtime, use the ! syntax to access the system shell and run conda commands. In a notebook cell, run:

# Replace <PACKAGE_NAME> with the name of the package you want to install
!conda install <PACKAGE_NAME>

Shutting down runtimes

It is best practice to shut down your runtime when you are finished working in it. To shut down a runtime, click Kernels in the top menu, then select the specific runtime you want to shut down or Shut Down All.