# How to Set Up the AI for Beginners Conda Environment Locally: Complete Installation Guide

> Install the AI for Beginners Conda environment locally with this complete guide. Clone the repo and create the ai4beg environment to run all curriculum notebooks in Jupyter.

- Repository: [Microsoft/AI-For-Beginners](https://github.com/microsoft/AI-For-Beginners)
- Tags: how-to-guide
- Published: 2026-08-05

---

**Clone the Microsoft AI for Beginners repository and create the `ai4beg` Conda environment using the root [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) to run all curriculum notebooks with a pre-configured Jupyter kernel.**

The **AI for Beginners** curriculum by Microsoft provides hands-on machine learning lessons through Jupyter notebooks. To run these notebooks locally, you need a dedicated **Conda environment** named **`ai4beg`** that bundles all required dependencies. This guide walks through the complete setup process using the official environment definitions in the repository.

## Prerequisites

Before installing the **AI for Beginners Conda environment**, ensure you have:

- **Conda** installed (Anaconda or Miniconda)
- **Git** for cloning the repository
- Approximately **2-5 GB** of free disk space (less with sparse checkout)

## Step 1: Clone the Microsoft AI for Beginners Repository

Start by downloading the curriculum source code. Navigate to your preferred directory and run:

```bash
git clone https://github.com/microsoft/AI-For-Beginners.git
cd AI-For-Beginners

```

This creates a local copy of the entire repository, including notebooks, data files, and configuration files.

### Optional: Skip Large Translation Assets

If you want to **reduce download size**, use a sparse checkout to exclude the `translations/` and `translated_images/` folders:

```bash
git clone --filter=blob:none --sparse https://github.com/microsoft/AI-For-Beginners.git
cd AI-For-Beginners
git sparse-checkout set --no-cone '/*' '!translations' '!translated_images'

```

This approach downloads only the core curriculum content, saving significant storage space.

## Step 2: Create the AI for Beginners Conda Environment

The repository includes a root-level **[`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml)** file that defines the complete environment. This file is also duplicated at [`.devcontainer/environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/.devcontainer/environment.yml) for container-based development.

Create the environment using Conda:

```bash
conda env create -f environment.yml

```

### What the Environment Includes

According to the [[`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml)](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) source, the `ai4beg` environment:

- Pulls packages from **`defaults`** and **`conda-forge`** channels
- Installs core scientific Python packages
- References **[`requirements.txt`](https://github.com/microsoft/AI-For-Beginners/blob/main/requirements.txt)** for additional Python dependencies
- Registers an **IPython kernel** (`ipykernel`) for Jupyter notebook execution

The environment is designed as a **single Conda environment** that supports the entire curriculum, eliminating the need to switch environments between lessons.

## Step 3: Activate the Environment and Verify Jupyter Kernel

Once creation completes, activate the environment:

```bash
conda activate ai4beg

```

Verify the Jupyter kernel is available:

```bash
jupyter kernelspec list

```

You should see `python3` or `ai4beg` in the list of available kernels. The `ipykernel` package installed by [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) automatically registers this kernel.

## Step 4: Launch Jupyter and Start Learning

With the environment active, start Jupyter Notebook or JupyterLab:

```bash
jupyter notebook

```

Or for JupyterLab:

```bash
jupyter lab

```

Navigate to any lesson folder and open the `.ipynb` notebook files. All imports should resolve without additional configuration.

## Alternative: Using VS Code Dev Container

For a containerized setup, the repository includes [[`.devcontainer/environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/.devcontainer/environment.yml)](https://github.com/microsoft/AI-For-Beginners/blob/main/.devcontainer/environment.yml). If using VS Code with the Dev Containers extension:

1. Open the repository in VS Code
2. Click "Reopen in Container" when prompted
3. The environment builds automatically from the Dev Container configuration

This approach isolates the **AI for Beginners** setup from your host system entirely.

## Troubleshooting Common Issues

### Environment Creation Fails

If Conda cannot resolve dependencies, try updating Conda first:

```bash
conda update -n base conda
conda env create -f environment.yml --force

```

### Kernel Not Showing in Jupyter

Manually install the kernel if needed:

```bash
ipython kernel install --user --name=ai4beg --display-name "Python (AI for Beginners)"

```

### Package Conflicts

The [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) specifies channel priority. If conflicts persist, clear Conda's package cache:

```bash
conda clean --all
conda env create -f environment.yml

```

## Summary

- **Clone** the `microsoft/AI-For-Beginners` repository using standard or sparse checkout
- **Create** the `ai4beg` Conda environment from root [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml)
- **Activate** with `conda activate ai4beg` to access the pre-configured Jupyter kernel
- **Launch** Jupyter and run any notebook without additional setup
- The same environment definition exists at [`.devcontainer/environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/.devcontainer/environment.yml) for container workflows

## Frequently Asked Questions

### What Python version does the AI for Beginners environment use?

The [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) specifies Python 3.x compatible with the curriculum's dependencies. Specific version pinning is handled through [`requirements.txt`](https://github.com/microsoft/AI-For-Beginners/blob/main/requirements.txt), which the environment references for comprehensive package management. Check the source file for the exact version constraint.

### Can I use pip instead of Conda for this setup?

While pip can install individual packages, the official **AI for Beginners** workflow relies on Conda for environment isolation and dependency resolution across scientific computing packages. The [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) orchestrates both Conda and pip installations internally via [`requirements.txt`](https://github.com/microsoft/AI-For-Beginners/blob/main/requirements.txt).

### How do I update the environment when requirements change?

Delete and recreate the environment:

```bash
conda activate base
conda remove --name ai4beg --all
conda env create -f environment.yml

```

Alternatively, update in place with `conda env update -f environment.yml` if the changes are additive.

### Is GPU support included in the environment?

The base [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) provides CPU-based scientific computing. GPU-accelerated packages like PyTorch or TensorFlow with CUDA support may require additional installation steps or modified environment files depending on your hardware and the specific lesson requirements.