How to Set Up the AI for Beginners Development Environment: 3 Methods Explained

You can set up the AI for Beginners development environment using three approaches: a local Conda environment created from .devcontainer/environment.yml, a Docker-based VS Code DevContainer, or cloud instances via GitHub Codespaces or Binder.

The Microsoft AI-For-Beginners repository provides a 12-week curriculum of Jupyter notebooks covering neural networks, computer vision, and reinforcement learning. To run the code examples locally or in the cloud, you need a Python runtime with scientific libraries including TensorFlow, PyTorch, OpenCV, and scikit-learn. The repository ships with configuration files that automate dependency management across all three supported installation methods.

The Conda approach gives you full control over the environment, supports GPU acceleration, and allows you to install additional packages. This method uses the environment.yml file located in .devcontainer/environment.yml to create an isolated ai4beg environment.

Clone the Repository (Sparse Checkout)

To reduce download size by excluding translation files, use Git’s sparse checkout feature as documented in README.md:

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'

Create the Conda Environment

First, install Miniconda if you haven’t already. Then create and activate the environment:

conda env create --name ai4beg --file .devcontainer/environment.yml
conda activate ai4beg

The environment.yml file lists all required dependencies including IPython, Jupyter, matplotlib, numpy, OpenCV, PyTorch, and TensorFlow.

Verify Core Libraries

Confirm that the major frameworks are correctly installed by running:

python -c "import torch, tensorflow as tf, cv2; print('PyTorch:', torch.__version__); print('TF:', tf.__version__); print('OpenCV:', cv2.__version__)"

Launch Jupyter

From the repository root, start the notebook server:

jupyter lab

Navigate to any lesson folder (for example, lessons/3-NeuralNetworks/03-Perceptron/Perceptron.ipynb) and execute the cells. The lessons/0-course-setup/how-to-run.md file contains additional configuration details for this workflow.

Method 2: VS Code DevContainer (Docker)

If you have Docker installed, you can run the entire curriculum inside a container without manually managing Conda. The repository includes a .devcontainer/devcontainer.json configuration that references the same environment.yml used for local setups.

To use this method:

  1. Open the repository folder in VS Code.
  2. When prompted, click "Reopen in Container".
  3. VS Code automatically builds the Docker image, installs dependencies, and mounts the workspace.

This approach isolates the environment and works identically across Windows, macOS, and Linux. If VS Code suggests reopening in a container while you are using the local Conda setup, you can decline to remain in your host environment.

Method 3: Cloud-Based Environment

For machines with limited resources or for quick demonstrations, use a cloud-hosted instance.

GitHub Codespaces

Click the Code → Codespaces button on the repository page to launch a pre-configured VS Code instance in the browser. The environment includes the same dependencies defined in .devcontainer/environment.yml, requiring no local installation.

Binder

Click the Binder badge in the README.md or navigate to https://mybinder.org/v2/gh/microsoft/ai-for-beginners/HEAD. Binder spins up a Jupyter server with the curriculum files. Note that Binder has limitations regarding external downloads and compute speed, as documented in lessons/0-course-setup/how-to-run.md.

For GPU-intensive lessons—such as deep reinforcement learning or computer vision training—consider Azure Data Science VMs or Azure Machine Learning notebooks, which provide dedicated GPU resources.

VS Code Integration for Local Development

When using the local Conda method, you can enhance the editing experience with VS Code’s Python extension:

  1. Open the repository folder in VS Code.
  2. Install the Python extension from the marketplace.
  3. VS Code automatically detects the ai4beg Conda environment and prompts you to select it as the interpreter.
  4. Open any .ipynb file to access the interactive notebook UI with IntelliSense and debugging capabilities.

Summary

  • Conda (local) is the most flexible option for learners who need GPU support and custom package management; it uses the ai4beg environment defined in .devcontainer/environment.yml.
  • VS Code DevContainer provides a reproducible Docker environment without local Conda installation, ideal for cross-platform consistency.
  • Cloud options (GitHub Codespaces or Binder) require zero setup but may have compute limitations for intensive training tasks.
  • The repository’s sparse checkout command (git sparse-checkout set --no-cone '/*' '!translations') minimizes download size by excluding translation files.
  • Key documentation files include README.md for overview instructions and lessons/0-course-setup/how-to-run.md for detailed runtime configuration.

Frequently Asked Questions

What Python version does the AI for Beginners environment require?

The environment specifies Python 3.8 or higher as defined in the .devcontainer/environment.yml file. The Conda environment automatically installs the compatible Python version when you run conda env create.

Can I use pip instead of Conda to install dependencies?

While the repository officially supports Conda, you can manually install the packages listed in .devcontainer/environment.yml using pip. However, some libraries like OpenCV and PyTorch have platform-specific binary dependencies that Conda handles more reliably than pip.

How do I access GPU support for the deep learning lessons?

For local setups, ensure you install the CUDA-enabled versions of PyTorch and TensorFlow when creating the Conda environment. The environment.yml includes GPU-compatible package specifications. Alternatively, use Azure Data Science VMs or Azure Machine Learning notebooks for cloud-based GPU resources.

Why should I use sparse checkout when cloning the repository?

Sparse checkout excludes the translations and translated_images directories, reducing the download size significantly. This is particularly useful if you only need the English curriculum content, as documented in the sparse checkout instructions in README.md.

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 →