3b1b/manim · error · IOError

{file_name} not Found

Error message

{file_name} not Found

What it means

Raised by the file-resolution helper in file_ops.py:59 after it exhausted every candidate path (directories x extensions) without finding the file. It is the common 'asset not found' error behind APIs like add_sound, SVGMobject file lookup, and any user of this resolver.

Source

Thrown at manimlib/utils/file_ops.py:59

        urllib.request.urlretrieve(file_name, path)
        return path

    # Check if what was passed in is already a valid path to a file
    if os.path.exists(file_name):
        return Path(file_name)

    # Otherwise look in local file system
    directories = directories or [""]
    extensions = extensions or [""]
    possible_paths = (
        Path(directory, file_name + extension)
        for directory in directories
        for extension in extensions
    )
    for path in possible_paths:
        if path.exists():
            return path
    raise IOError(f"{file_name} not Found")

View on GitHub (pinned to dee01804d4)

Solutions

  1. Verify the exact filename (and case) exists: ls the directory you believe holds it
  2. Pass an absolute path, or place the file in a searched directory (e.g. next to the script / media folder)
  3. If the API takes an extensions list, include the real extension of your file

Example fix

# before
self.add_sound('bell')  # bell.wav not found in search dirs -> raises

# after
from pathlib import Path
self.add_sound(str(Path(__file__).parent / 'bell.wav'))
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
p = Path(file_name)
if not p.exists():
    p = Path(__file__).parent / file_name
assert p.exists(), f'asset not found: {file_name}'

Try / catch

try:
    self.add_sound(name)
except IOError:
    pass  # or log and continue without audio

Prevention

When it happens

Trigger: add_sound('music.mp3') when the file is not in the media/sound search directories or cwd; requesting 'icon' with extensions ['.svg'] while the file is named icon.png; wrong-case filenames on case-sensitive filesystems.

Common situations: Assets living outside the directories manim searches (cwd, media dirs); CI checkout missing binary assets; extensions list not covering the actual file; running the scene from a different working directory.

Related errors


AI-assisted analysis of 3b1b/manim@dee01804d4 (2026-08-14). Data as JSON: /api/errors/fde420ca83e6ada3. Report an issue: GitHub.