{"record":{"id":"fde420ca83e6ada3","repo":"3b1b/manim","slug":"file-name-not-found","errorCode":null,"errorMessage":"{file_name} not Found","messagePattern":"(.+?) not Found","errorType":"exception","errorClass":"IOError","httpStatus":null,"severity":"error","filePath":"manimlib/utils/file_ops.py","lineNumber":59,"sourceCode":"        urllib.request.urlretrieve(file_name, path)\n        return path\n\n    # Check if what was passed in is already a valid path to a file\n    if os.path.exists(file_name):\n        return Path(file_name)\n\n    # Otherwise look in local file system\n    directories = directories or [\"\"]\n    extensions = extensions or [\"\"]\n    possible_paths = (\n        Path(directory, file_name + extension)\n        for directory in directories\n        for extension in extensions\n    )\n    for path in possible_paths:\n        if path.exists():\n            return path\n    raise IOError(f\"{file_name} not Found\")\n","sourceCodeStart":41,"sourceCodeEnd":60,"githubUrl":"https://github.com/3b1b/manim/blob/dee01804d47b9f94402d71472674710dcac125b8/manimlib/utils/file_ops.py#L41-L60","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the exact filename (and case) exists: ls the directory you believe holds it","Pass an absolute path, or place the file in a searched directory (e.g. next to the script / media folder)","If the API takes an extensions list, include the real extension of your file"],"exampleFix":"# before\nself.add_sound('bell')  # bell.wav not found in search dirs -> raises\n\n# after\nfrom pathlib import Path\nself.add_sound(str(Path(__file__).parent / 'bell.wav'))","handlingStrategy":"validation","validationCode":"from pathlib import Path\np = Path(file_name)\nif not p.exists():\n    p = Path(__file__).parent / file_name\nassert p.exists(), f'asset not found: {file_name}'","typeGuard":null,"tryCatchPattern":"try:\n    self.add_sound(name)\nexcept IOError:\n    pass  # or log and continue without audio","preventionTips":["Pass absolute paths for assets, or place them in searched directories","Verify asset filenames and case before rendering","Make CI check that referenced media files exist in the checkout"],"tags":["manim","file-not-found","asset","io","environment"],"backgroundTag":null,"analyzedSha":"dee01804d47b9f94402d71472674710dcac125b8","analyzedAt":"2026-08-14T19:53:44.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}