# AI-For-Beginners Prerequisites: Complete Setup Guide for Microsoft's AI Curriculum

> Master AI-For-Beginners prerequisites. Easily set up Conda Python PyTorch TensorFlow & Jupyter for Microsoft's AI curriculum. Get started now.

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

---

**The Microsoft AI-For-Beginners curriculum requires Conda (or Miniconda), Python 3.x, PyTorch, TensorFlow 2.x, and Jupyter, installable via [`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) to run 24 lessons locally or in a devcontainer.**

The Microsoft AI-For-Beginners repository is a comprehensive 12-week, 24-lesson open-source curriculum covering neural networks, computer vision, and natural language processing. Before executing the hands-on exercises, you must provision a Python data-science stack capable of running dual-framework implementations. Understanding these AI-For-Beginners prerequisites ensures seamless execution of all Jupyter notebooks within the `lessons/` directory structure.

## Core Prerequisites and Dependencies

The curriculum utilizes a dual-package management system: Conda handles core scientific libraries and complex binaries, while pip manages additional deep-learning utilities. According to the [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) specification, the foundation requires **Python 3.x** (line 12) alongside standard data-science packages including `numpy`, `pandas`, `matplotlib`, `scikit-learn`, `scipy`, and `opencv` (lines 5-18).

### Deep Learning Frameworks

Unlike courses restricted to a single ecosystem, AI-For-Beginners provides parallel implementations in both PyTorch and TensorFlow. The [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) configures **PyTorch** distributions—including `torchvision`, `torchtext`, and `torchdata`—through dedicated Conda channels (lines 19-22), while **TensorFlow 2.x** and Keras are installed via the pip section (line 16). The separate [`requirements.txt`](https://github.com/microsoft/AI-For-Beginners/blob/main/requirements.txt) file handles pip-only dependencies such as `tensorflow-datasets`, `huggingface`, `gym`, and `gensim` (lines 1-8).

### Jupyter Environment

All 24 lessons are delivered as executable **Jupyter notebooks** (`.ipynb`). The [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) explicitly lists `jupyter` (line 9) to ensure notebook server capability. You can launch either classic Jupyter Notebook or JupyterLab to interact with files located in paths like `lessons/3-NeuralNetworks/03-Perceptron/Perceptron.ipynb`.

## Step-by-Step Installation Workflow

Follow this exact provisioning sequence derived from [`lessons/0-course-setup/setup.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/0-course-setup/setup.md) to configure your local environment.

### 1. Clone the Repository

Use sparse checkout to exclude translation files if bandwidth is limited:

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

```

### 2. Create the Conda Environment

Build the environment using the supplied specification, which resolves the scientific stack and PyTorch binaries:

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

```

### 3. Install Pip-Only Dependencies

Supplement the Conda installation with packages exclusive to [`requirements.txt`](https://github.com/microsoft/AI-For-Beginners/blob/main/requirements.txt):

```bash
pip install -r requirements.txt

```

### 4. Launch Jupyter

Start the notebook server and navigate to specific lessons:

```bash
jupyter lab

# Then open e.g., lessons/1-Introduction/1-intro-to-ML/IntroToML.ipynb

```

## Optional but Recommended Configurations

While the base setup runs on CPU-only machines, several enhancements improve developer experience and computational performance.

### Devcontainer Setup

For a reproducible, containerized environment, the repository includes a `.devcontainer/` configuration. Open the project in **VS Code** with the Dev Containers extension installed, then select "Reopen in Container" when prompted. This Docker-based approach automatically installs dependencies without manual Conda management, as documented in the README's *Alternative: Using devcontainer* section.

### GPU Support

Later lessons in computer vision and NLP benefit significantly from CUDA-compatible GPUs. The [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) includes GPU-ready PyTorch builds. Verify hardware detection after setup:

```python
import torch
print('CUDA available:', torch.cuda.is_available())

import tensorflow as tf
print(tf.config.list_physical_devices('GPU'))

```

### Additional Tools

The repository includes an optional Vue.js quiz application located in `etc/quiz-app/`. This component requires **npm** and Node.js to run locally, as detailed in [`etc/quiz-app/README.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/etc/quiz-app/README.md). While not required for the core curriculum, it provides interactive knowledge checks for the 24-lesson structure.

## Key Configuration Files Reference

Understanding these source files helps troubleshoot environment issues and verify AI-For-Beginners prerequisites:

- **[`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml)**: Defines the Conda environment name (`ai4beg`), Python version constraints (line 12), and channel priorities for PyTorch packages (lines 19-22).
- **[`requirements.txt`](https://github.com/microsoft/AI-For-Beginners/blob/main/requirements.txt)**: Lists pip-installable packages including `keras`, `tensorflow-datasets`, and reinforcement learning environments like `gym` (lines 1-8).
- **[`lessons/0-course-setup/setup.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/0-course-setup/setup.md)**: Contains platform-specific troubleshooting and alternative installation methods.
- **`.devcontainer/`**: Houses Docker configurations for cloud-based development environments.
- **[`etc/quiz-app/README.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/etc/quiz-app/README.md)**: Instructions for the optional npm-based quiz application.

## Summary

- **Conda or Miniconda** is mandatory for environment management according to the official setup instructions.
- **Python 3.x** serves as the base interpreter, with exact versions pulled from [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) line 12.
- **Dual frameworks** (PyTorch and TensorFlow 2.x) are required because lessons provide implementations in both ecosystems.
- **Jupyter** is essential for executing the `.ipynb` lesson notebooks located in the `lessons/` directory.
- **GPU acceleration** is optional but recommended for advanced computer vision and NLP modules.
- **Devcontainer support** offers a Docker-based alternative to local Conda installation.

## Frequently Asked Questions

### Can I use pip instead of Conda to install AI-For-Beginners dependencies?

While technically possible, the official [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) uses Conda channels to manage complex binary dependencies like PyTorch and OpenCV more reliably than pip alone. If you must use pip exclusively, manually resolve the CUDA-enabled PyTorch wheels and system-level libraries listed in the Conda specification, though this approach is not tested by the maintainers.

### What Python version does AI-For-Beginners require?

The curriculum targets Python 3.x without pinning a specific minor version. The [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) file (line 12) pulls the latest compatible Python 3 release available in the conda-forge channel, typically 3.8 or higher depending on dependency resolution.

### Is a GPU necessary to complete the AI-For-Beginners curriculum?

No, all 24 lessons execute on CPU-only machines. However, the README specifically notes GPU support for advanced lessons involving large-scale computer vision and natural language processing models. If available, a CUDA-compatible GPU significantly reduces training time for these specific modules.

### How do I verify my AI-For-Beginners installation is correct?

After activating the `ai4beg` environment and installing 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) dependencies, run the GPU verification commands or simply launch `jupyter lab` and execute the first cell of `lessons/1-Introduction/1-intro-to-ML/IntroToML.ipynb`. Successful import of `torch`, `tensorflow`, and `sklearn` without ImportError messages confirms proper setup.