How to Set Up the Microsoft AI for Beginners Project Locally Using Conda

To set up the Microsoft AI for Beginners curriculum locally, install Miniconda, clone the repository, create the Conda environment from environment.yml, activate the ai4beg environment, and launch Jupyter Notebook to access the lessons at http://localhost:8888.

The Microsoft AI for Beginners repository is an open-source educational curriculum containing Jupyter notebooks, supporting scripts, and a Vue-based quiz application. Setting up the AI for Beginners project locally using Conda ensures all dependencies—TensorFlow, PyTorch, OpenCV, and scikit-learn—are isolated and correctly configured according to the source specifications.

Prerequisites: Install Miniconda

Before cloning the repository, you need the Conda package manager. The repository recommends Miniconda, a lightweight installer that provides isolated Python runtimes without the full Anaconda distribution.

For Linux or macOS, run:

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"

Windows users should download and run the Miniconda installer from the official Conda website.

Clone the Repository

Navigate to your desired directory and clone the GitHub repository to pull all lesson notebooks, data files, and configuration files:

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

Create and Activate the Conda Environment

The repository defines the Python environment in environment.yml at the root directory. This YAML file specifies the environment name ai4beg and includes core dependencies like numpy, matplotlib, opencv, and pytorch, while also pulling additional packages from requirements.txt.

Create the environment by running:

conda env create -f environment.yml

Once created, activate the environment to register the Jupyter kernel and put the installed packages on your PATH:

conda activate ai4beg

If you prefer using the VS Code dev-container configuration locally, you can alternatively point to the mirror spec:

conda env create -f .devcontainer/environment.yml

Launch Jupyter Notebook

According to lessons/0-course-setup/how-to-run.md, once the environment is activated, you can start Jupyter to serve the curriculum notebooks locally.

Launch the notebook server:

jupyter notebook

Alternatively, use JupyterLab:

jupyter lab

This serves the application at http://localhost:8888, allowing you to navigate to any lesson under lessons/.../*.ipynb and execute the code cells with all dependencies properly loaded.

Alternative: VS Code Dev Container Setup

If you prefer containerized development over local Conda installation, the repository includes a .devcontainer configuration. Opening the project in Visual Studio Code triggers a prompt to "Reopen in Container," which builds the same ai4beg environment inside Docker using .devcontainer/environment.yml. The configuration file .devcontainer/devcontainer.json orchestrates this containerized setup, mirroring the dependencies defined in the top-level YAML file.

Summary

  • Install Miniconda to obtain the conda package manager and isolated Python runtimes
  • Clone the repository from https://github.com/microsoft/AI-For-Beginners.git
  • Create the environment using conda env create -f environment.yml to build the ai4beg environment
  • Activate the environment with conda activate ai4beg to access TensorFlow, PyTorch, and other dependencies
  • Launch Jupyter via jupyter notebook to run all curriculum notebooks locally

Frequently Asked Questions

What is the exact name of the Conda environment for AI for Beginners?

The environment is named ai4beg as defined in the name field of environment.yml. You must activate this specific environment using conda activate ai4beg before launching Jupyter, as this ensures the kernel has access to all required machine learning libraries listed in the configuration.

Can I use pip instead of Conda to set up the project?

While the repository includes a requirements.txt file referenced by environment.yml, the official documentation in lessons/0-course-setup/how-to-run.md recommends Conda for setup. Conda properly handles binary dependencies like OpenCV and PyTorch across platforms, whereas pip may fail to resolve system-level library requirements correctly.

What Python packages are included in the ai4beg environment?

The environment.yml bundles major machine learning frameworks including TensorFlow and PyTorch, computer vision libraries such as OpenCV, and data science staples like NumPy, matplotlib, and scikit-learn. Additional packages are installed via pip from requirements.txt during the environment creation process.

How do I verify the environment is working correctly?

After running conda activate ai4beg, launch jupyter notebook and open any notebook file (e.g., lessons/3-NeuralNetworks/03-Perceptron/Perceptron.ipynb). If the kernel starts without import errors for TensorFlow or PyTorch, your local setup using Conda is functioning correctly.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →