affaan-m/ECC · error · FileNotFoundError

no style pack ' ' under - run mint.py first

Error message

no style pack '{name}' under {root} - run mint.py first

What it means

pack.load constructs a StylePack for the given name/root and requires its manifest file to exist; if manifest_path is missing it raises FileNotFoundError telling you to run mint.py first. The manifest is the pack's source of truth (LUT paths, parameters), so a pack without one is considered not minted at all. The root defaults to DEFAULT_ROOT but is user-suppliable.

Solutions

  1. Run mint.py with the same name/root to mint the pack: python mint.py --name <name> (check mint.py's CLI for exact flags).
  2. Verify the expected manifest path on disk (e.g. ls <root>/<name>/manifest.json) and fix the name argument to match exactly, including case.
  3. Pass the correct root explicitly: load(name, root='/path/to/packs') if packs live outside DEFAULT_ROOT.
  4. If only the manifest is missing, restore it from version control or regenerate the pack; a directory without a manifest is treated as nonexistent by design.
  5. Wrap in try/except FileNotFoundError to print a helpful hint listing available packs under root.

Example fix

// before
pack = pack.load('teal_orange')  # FileNotFoundError: no style pack 'teal_orange' ... run mint.py first
// after
from pathlib import Path
root = Path('packs')
if not (root / 'teal_orange' / 'manifest.json').exists():
    subprocess.run(['python', 'mint.py', '--name', 'teal_orange', '--root', str(root)], check=True)
pack = pack.load('teal_orange', root=root)
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
root = Path(root_arg)
manifest = root / name / 'manifest.json'
if not manifest.is_file():
    available = [d.name for d in root.iterdir() if d.is_dir()] if root.is_dir() else []
    raise SystemExit(f'pack {name!r} not minted; available: {available} (run mint.py)')

Try / catch

try:
    pack = pack.load(name, root=root)
except FileNotFoundError as e:
    logger.warning('style pack missing, minting now: %s', e)
    subprocess.run(['python', 'mint.py', '--name', name, '--root', str(root)], check=True)
    pack = pack.load(name, root=root)

Prevention

When it happens

Trigger: load('packname') where: mint.py was never run for that name, the name is misspelled or differs in case, root points at a different directory than where the pack was minted, or the manifest json was deleted/moved while the pack folder still exists.

Common situations: Sharing packs by copying only the .cube files and forgetting the manifest json; running scripts from another cwd with a relative root; renaming a pack folder by hand so the name no longer matches; a crashed mint.py run that created a partial directory without a manifest.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/2a77308f7fbdd895. Report an issue: GitHub.

Appendix: source

Thrown at skills/taste-distillation/scripts/taste/pack.py:149

        return path

    def read_json(self, path: Path) -> dict:
        if not path.exists():
            return {}
        return json.loads(path.read_text(encoding="utf-8"))

    def archive(self, dest_dir: str | Path = "out") -> Path:
        """Zip the pack so a whole taste can be handed off as one file."""
        dest_dir = Path(dest_dir)
        dest_dir.mkdir(parents=True, exist_ok=True)
        base = dest_dir / f"{self.name}-stylepack"
        return Path(shutil.make_archive(str(base), "zip", root_dir=self.dir))


def load(name: str, root: str | Path = DEFAULT_ROOT) -> StylePack:
    p = StylePack(name=name, root=Path(root))
    if not p.manifest_path.exists():
        raise FileNotFoundError(
            f"no style pack '{name}' under {root} - run mint.py first"
        )
    p.manifest = json.loads(p.manifest_path.read_text(encoding="utf-8"))
    return p


def create(name: str, root: str | Path = DEFAULT_ROOT) -> StylePack:
    return StylePack(name=name, root=Path(root)).ensure()


def list_packs(root: str | Path = DEFAULT_ROOT) -> list[str]:
    root = Path(root)
    if not root.exists():
        return []
    return sorted(d.name for d in root.iterdir() if (d / "pack.json").exists())

View on GitHub (pinned to 8321021c54)