Skip to content

MLR104: Literal asset path does not resolve in the render search path

qual reports MLR104 when a literal path passed to SVGMobject(file_name=...) or ImageMobject(filename_or_array=...) cannot be resolved with exactly Manim's runtime search (seek_full_path_from_defaults):

  1. Path(file_name) against the render profile's working directory;
  2. assets_dir / f"{file_name}{ext}" for ext in ["", *extensions] (.svg for SVGMobject; .jpg .jpeg .png .gif .ico for ImageMobject).

  3. Default severity: error

  4. Minimum confidence: high
  5. Implementation phase: 1
  6. Fix: safe case correction for case-only mismatches

The source file's directory and the project root are not part of Manim's search; a file found there is reported as extra evidence only. A path that matches an existing file case-insensitively gets a SAFE fix rewriting the literal to the on-disk case, with platform-specific wording. ~ paths, Windows-style paths on a POSIX profile, f-strings, and a missing working directory are unverifiable and stay silent. The diagnostic lists the profiles (applicable_profiles) whose search failed.

The case-only branch applies only to profiles targeting a case-sensitive platform (linux): on windows/macos targets the render's lookup finds the file as written, so a mismatch affecting only case-insensitive targets is not reported at all. An unresolved absolute path outside the project tree is checked against the linting machine's filesystem — a true positive when linting and rendering happen on the same machine (the common case), but environment-dependent when they do not; such diagnostics carry environment_dependent: true as evidence.

Wrong:

SVGMobject("Logo.svg")     # on-disk file is logo.svg: fails on linux
ImageMobject("missing")    # no candidate exists: OSError at render time

Right:

SVGMobject("logo.svg")     # exact on-disk case
ImageMobject("picture")    # assets_dir/picture.png found via extensions