deezer/spleeter · error · SpleeterError

No embedded configuration {name} found

Error message

No embedded configuration {name} found

What it means

load_configuration supports descriptors prefixed with the embedded configuration prefix (e.g. 'spleeter:2stems'); it strips the prefix and looks up '<name>.json' inside the packaged spleeter.resources module. If importlib.resources cannot find that resource, it raises SpleeterError. This means the named bundled configuration does not exist in your installed spleeter package — either the name is wrong or the installation is broken/incomplete.

Source

Thrown at spleeter/utils/configuration.py:44

    Parameters:
        descriptor (str):
            Configuration descriptor to use for lookup.

    Returns:
        Dict:
            Loaded description as dict.

    Raises:
        ValueError:
            If required embedded configuration does not exists.
        SpleeterError:
            If required configuration file does not exists.
    """
    # Embedded configuration reading.
    if descriptor.startswith(_EMBEDDED_CONFIGURATION_PREFIX):
        name = descriptor[len(_EMBEDDED_CONFIGURATION_PREFIX) :]
        if not loader.is_resource(resources, f"{name}.json"):
            raise SpleeterError(f"No embedded configuration {name} found")
        with loader.open_text(resources, f"{name}.json") as stream:
            return json.load(stream)
    # Standard file reading.
    if not exists(descriptor):
        raise SpleeterError(f"Configuration file {descriptor} not found")
    with open(descriptor, "r") as stream:
        return json.load(stream)

View on GitHub (pinned to c8854001ac)

Solutions

  1. Check the exact embedded names available in spleeter/resources (e.g. 2stems.json, 4stems.json, 5stems.json) and correct the descriptor spelling
  2. List the package contents: python -c "import spleeter.resources, importlib.resources as r; print(list(r.contents(spleeter.resources)))" to confirm the json ships in your install
  3. Reinstall spleeter cleanly (pip uninstall && pip install spleeter) so package data is restored
  4. If you need a custom config, pass a filesystem path to the json instead of the embedded 'spleeter:' descriptor

Example fix

// before
separator = Separator('spleeter:2-stems')  # SpleeterError: No embedded configuration
// after
separator = Separator('spleeter:2stems')
Defensive patterns

Strategy: try-catch

Validate before calling

import importlib.resources as resources
import spleeter.resources

def embedded_config_exists(name: str) -> bool:
    return resources.is_resource(spleeter.resources, f'{name}.json')

assert embedded_config_exists('2stems'), 'use spleeter:2stems / 4stems / 5stems'

Type guard

def is_valid_embedded_descriptor(descriptor: str) -> bool:
    if not descriptor.startswith('spleeter:'):
        return False
    name = descriptor[len('spleeter:'):]
    import importlib.resources as resources, spleeter.resources
    return resources.is_resource(spleeter.resources, f'{name}.json')

Try / catch

from spleeter import SpleeterError
try:
    separator = Separator('spleeter:2stems')
except SpleeterError as e:
    if 'No embedded configuration' in str(e):
        print('Unknown embedded config; valid: 2stems, 4stems, 5stems')
    else:
        raise

Prevention

When it happens

Trigger: Passing an embedded descriptor like 'spleeter:2stems', 'spleeter:4stems-json' or a typo'd name whose '<name>.json' is not present in the resources package — typically via Separator('spleeter:<name>') or training scripts calling load_configuration directly.

Common situations: Typos such as 'spleeter:2stem' or 'spleeter:2-stems'; using a config name from a newer spleeter version than the one installed; broken wheels/conda installs where the package data (json resources) was not shipped; exotic environments where importlib.resources cannot see package data (old Python with backport quirks).

Related errors


AI-assisted analysis of deezer/spleeter@c8854001ac (2026-08-28). Data as JSON: /api/errors/bacf3f8d8af06674. Report an issue: GitHub.