deepinsight/insightface · error · RuntimeError

Unsupported platform: {} {}

Error message

Unsupported platform: {} {}

What it means

During wheel packaging, get_wheel_platform_tag maps (machine, system) through the arch_mapping table (or the INSPIRE_FACE_TARGET_AARCH_MAPPING env override) to pick a platform tag for the bundled native library. If no entry matches the build host and the env var is unset, it prints the pair and raises this RuntimeError — no prebuilt lib tag exists for this host.

Source

Thrown at cpp-package/inspireface/python/setup.py:58

        },
        'arm64': {
            'windows': 'win_arm64',
            'linux': 'manylinux2014_aarch64',
            'darwin': 'macosx_11_0_arm64'
        },
        'aarch64': {
            'windows': 'win_arm64',
            'linux': 'manylinux2014_aarch64',
            'darwin': 'macosx_11_0_arm64'
        }
    }
    if os.getenv('INSPIRE_FACE_TARGET_AARCH_MAPPING'):
        platform_arch = os.getenv('INSPIRE_FACE_TARGET_AARCH_MAPPING')
    else:
        platform_arch = arch_mapping.get(machine, {}).get(system)
    if not platform_arch:
        print("Unsupported platform: {} {}".format(system, machine))
        raise RuntimeError("Unsupported platform: {} {}".format(system, machine))
    
    return platform_arch

def get_lib_path_info():
    """Get library file path information"""
    system = platform.system().lower()
    machine = platform.machine().lower()
    
    if system == 'windows':
        arch = 'x64' if machine in ['amd64', 'x86_64'] else 'arm64'
    elif system == 'linux':
        arch = 'x64' if machine == 'x86_64' else 'arm64'
    elif system == 'darwin':
        if machine == 'x86_64':
            try:
                is_rosetta = bool(int(subprocess.check_output(
                    ['sysctl', '-n', 'sysctl.proc_translated']).decode().strip()))
                arch = 'arm64' if is_rosetta else 'x64'

View on GitHub (pinned to 7fadd420c2)

Solutions

  1. Set INSPIRE_FACE_TARGET_AARCH_MAPPING to a valid target (e.g. 'linux/x64' or 'linux/arm64') matching the bundled libs.
  2. Inspect the arch_mapping dict in setup.py and build on one of the listed platform/arch combinations.
  3. If your host should be supported, verify platform.machine()/system() output and patch/extend the mapping locally.

Example fix

# before
python setup.py bdist_wheel  # RuntimeError: Unsupported platform: linux riscv64

# after
export INSPIRE_FACE_TARGET_AARCH_MAPPING='linux/x64'
python setup.py bdist_wheel
Defensive patterns

Strategy: validation

Validate before calling

import platform, os
key = (platform.machine(), platform.system().lower())
if not os.getenv('INSPIRE_FACE_TARGET_AARCH_MAPPING') and key not in KNOWN_ARCH_MAPPING:
    raise SystemExit('set INSPIRE_FACE_TARGET_AARCH_MAPPING before building')

Try / catch

try:
    subprocess.check_call([sys.executable, 'setup.py', 'bdist_wheel'])
except subprocess.CalledProcessError:
    os.environ['INSPIRE_FACE_TARGET_AARCH_MAPPING'] = 'linux/x64'
    subprocess.check_call([sys.executable, 'setup.py', 'bdist_wheel'])

Prevention

When it happens

Trigger: Running setup.py bdist_wheel / pip wheel on a (machine, system) pair absent from arch_mapping — e.g. windows-arm64, freebsd, or an unrecognized platform.machine() string — without setting INSPIRE_FACE_TARGET_AARCH_MAPPING.

Common situations: Exotic or new CI runners not in the mapping table; cross-build scripts that forgot the env override; platform.machine() returning an unexpected alias (e.g. 'AMD64' vs 'x86_64' on nonstandard hosts).

Related errors


AI-assisted analysis of deepinsight/insightface@7fadd420c2 (2026-08-28). Data as JSON: /api/errors/f1753e7667ec0a44. Report an issue: GitHub.