Full Guide to Installing Manim on WSL with Anaconda and All Dependencies (Including LaTeX)

This step-by-step guide will walk you through installing Manim on WSL (Windows Subsystem for Linux) with Anaconda, along with all the necessary system libraries like FFmpeg, Cairo, Pango, and LaTeX. By the end of this guide, you'll have a fully functional Manim installation, ready to render animations.

Prerequisites

Before you begin, ensure you have the following:

  1. WSL: Ensure that Windows Subsystem for Linux (WSL) is set up on your system.
  2. Anaconda: Installed within WSL. You can install it from the official guide.

Step 1: Create and Activate a Conda Environment for Manim

It’s a good idea to create a separate Conda environment for Manim to manage dependencies cleanly.

  1. Open your WSL terminal.

  2. Create a new Conda environment with Python 3.10:

    conda create -n manim_env python=3.10
    
    
  3. Activate the environment:

    conda activate manim_env
    
    

Now, all installations will be scoped to this environment.

Step 2: Install Required Build Tools and Libraries

Manim depends on system-level libraries such as Cairo and Pango for text rendering and FFmpeg for video rendering. You need to install these libraries before proceeding.

  1. Run the following commands to install essential development tools:

    sudo apt-get update
    sudo apt-get install build-essential libcairo2-dev libpango1.0-dev pkg-config python3-dev
    
    

Step 3: Install FFmpeg for Video Rendering

Manim uses FFmpeg to handle video rendering. You have two installation options: using Conda (recommended) or installing it globally using sudo.

Option 1: Install FFmpeg using Conda (Recommended)

This keeps FFmpeg scoped to your environment, avoiding potential conflicts with system-wide packages.