# How to Run Jupyter Notebooks in the Microsoft AI for Beginners Course: Complete Setup Guide

> Learn how to run Jupyter notebooks for the Microsoft AI for Beginners course. Clone the repo, set up a conda environment, and launch Jupyter to begin interactive AI lessons.

- Repository: [Microsoft/AI-For-Beginners](https://github.com/microsoft/AI-For-Beginners)
- Tags: getting-started
- Published: 2026-08-21

---

**Clone the AI-For-Beginners repository, create a conda environment from [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml), and launch Jupyter Notebook or JupyterLab to start the interactive lessons.**

The Microsoft **AI for Beginners** curriculum is built entirely around interactive Jupyter notebooks. To run them, you need a working Python environment, the required dependencies specified in the project's configuration files, and the Jupyter server itself. This guide walks through the exact setup process using the source files in the `microsoft/AI-For-Beginners` repository.

## Clone the Repository (Full or Sparse Checkout)

The README in the repository root provides two ways to obtain the codebase. A full clone pulls all 50+ translation files, while a **sparse checkout** skips those large folders for a faster download.

### Option 1: Full Clone

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

```

### Option 2: Sparse Checkout (Recommended)

This approach omits translation files and is significantly faster:

```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'

```

The sparse checkout command is defined in [`README.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/README.md) lines 31-40 according to the source analysis.

## Create a Python Environment with Dependencies

The project ships an [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) file that lists all required packages, including Jupyter itself, ipykernel, ipywidgets, OpenCV, and PyTorch.

### Using Conda (Recommended)

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

```

The [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) specifies these dependencies in lines 5-11.

### Using Virtualenv + Pip

If you prefer pip-based installation, use the provided [`requirements.txt`](https://github.com/microsoft/AI-For-Beginners/blob/main/requirements.txt):

```bash
python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate

pip install -r requirements.txt

```

Both [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) and [`requirements.txt`](https://github.com/microsoft/AI-For-Beginners/blob/main/requirements.txt) are located in the repository root.

## Install Jupyter Notebook Server

If Jupyter is not already present in your environment, install it explicitly. The troubleshooting guide in [`troubleshoot.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/troubleshoot.md) (lines 79-99) provides the exact commands:

```bash

# Using pip

pip install notebook

# Or using conda

conda install notebook

```

For an enhanced interface, you can also install JupyterLab:

```bash
pip install jupyterlab

```

## Launch Jupyter and Open Course Notebooks

Start the Jupyter server from the repository root. It will automatically open your default web browser, or you can copy the URL printed in the terminal.

```bash

# Classic Notebook interface

jupyter notebook

# Or JupyterLab (richer UI with file browser)

jupyter lab

```

Once the browser opens, navigate to the `lessons/` folder and select any notebook. For example:

```

lessons/3-NeuralNetworks/03-Perceptron/Perceptron.ipynb

```

Each lesson also contains a README describing learning objectives and any required dataset downloads.

## Complete Setup Command Sequence

Here is the full workflow from clone to running your first notebook:

```bash

# 1️⃣ Clone (sparse recommended) and enter repo

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'

# 2️⃣ Build the conda environment

conda env create -f environment.yml
conda activate ai4beg

# 3️⃣ Ensure Jupyter is installed

pip install notebook   # or: conda install notebook

# 4️⃣ Start the notebook server

jupyter notebook   # or: jupyter lab

# 5️⃣ In the browser, open lessons, for example:

# lessons/4-ComputerVision/07-ConvNets/ConvNetsPyTorch.ipynb

```

## Key Configuration Files Reference

| File | Purpose |
|------|---------|
| [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) | Lists exact conda packages including Jupyter, PyTorch, OpenCV |
| [`requirements.txt`](https://github.com/microsoft/AI-For-Beginners/blob/main/requirements.txt) | Pip-based dependency list for manual installations |
| [`lessons/0-course-setup/setup.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/0-course-setup/setup.md) | Overview of required tools and quick-start steps |
| [`lessons/0-course-setup/how-to-run.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/0-course-setup/how-to-run.md) | Detailed Jupyter launch and navigation instructions |
| [`troubleshoot.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/troubleshoot.md) | Common issues (missing Jupyter, kernel errors) and fixes |

## Alternative: Run Notebooks in the Cloud

If local setup is not feasible, the AI for Beginners notebooks can also run on cloud platforms such as Google Colab or Azure Notebooks. Most notebooks include "Open in Colab" badges for direct execution without local installation.

## Summary

- **Clone** the repository using standard git or a sparse checkout for faster download
- **Create environment** from [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) using conda or [`requirements.txt`](https://github.com/microsoft/AI-For-Beginners/blob/main/requirements.txt) with pip
- **Install Jupyter** via `pip install notebook` or `conda install notebook` if not present
- **Launch** with `jupyter notebook` or `jupyter lab` from the repository root
- **Navigate** to `lessons/` and select any `.ipynb` file to start learning

## Frequently Asked Questions

### What Python version does AI for Beginners require?

The [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) specifies Python 3.8 or later. Conda will automatically install a compatible version when you create the environment from that file.

### Can I use pip instead of conda to run Jupyter notebooks in AI for Beginners?

Yes. While conda is recommended, you can create a virtual environment with `python -m venv` and install dependencies from [`requirements.txt`](https://github.com/microsoft/AI-For-Beginners/blob/main/requirements.txt). Then install Jupyter with `pip install notebook` and proceed with `jupyter notebook`.

### Where are the actual lesson notebooks located in the repository?

All interactive notebooks are organized under `lessons/` with subdirectories for each module. For example: `lessons/3-NeuralNetworks/03-Perceptron/Perceptron.ipynb`. The [`lessons/0-course-setup/how-to-run.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/0-course-setup/how-to-run.md) file provides additional navigation guidance.

### What should I do if Jupyter fails to start or shows "command not found"?

Check [`troubleshoot.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/troubleshoot.md) lines 79-99 for specific fixes. Most commonly, Jupyter is not installed in your active environment. Run `pip install notebook` or `conda install notebook`, then ensure your environment is activated with `conda activate ai4beg` before launching.