{"record":{"id":"5215e6f600afc271","repo":"slint-ui/slint","slug":"could-not-load-the-slint-dev-development-binary","errorCode":null,"errorMessage":"Could not load the slint-dev development binary: {error}","messagePattern":"Could not load the slint-dev development binary: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"api/python/slint/slint/_native.py","lineNumber":61,"sourceCode":"        except importlib.metadata.PackageNotFoundError:\n            dev_version = None\n\n        if dev_version is not None:\n            own_version = importlib.metadata.version(\"slint\")\n            if dev_version != own_version:\n                warnings.warn(\n                    f\"Ignoring slint-dev {dev_version}: it does not match slint \"\n                    f\"{own_version}. Install slint-dev=={own_version} to enable the \"\n                    \"development binary with system-testing and MCP support.\",\n                    stacklevel=2,\n                )\n            else:\n                try:\n                    return importlib.import_module(\"slint_dev_native\")\n                except ImportError as error:\n                    # Installed, but its native binary is unavailable on this\n                    # platform. Fall back to the lean release binary.\n                    warnings.warn(\n                        f\"Could not load the slint-dev development binary: {error}\",\n                        stacklevel=2,\n                    )\n\n    from . import slint as native\n\n    return native\n\n\nif TYPE_CHECKING:\n    # Both binary variants expose the same surface, so type-check against the\n    # bundled extension's stub (slint.pyi).\n    from . import slint as native\nelse:\n    native = _load_native()\n","sourceCodeStart":43,"sourceCodeEnd":77,"githubUrl":"https://github.com/slint-ui/slint/blob/3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016/api/python/slint/slint/_native.py#L43-L77","documentation":"When dev mode is requested (SLINT_TEST_SERVER or SLINT_MCP_PORT set), the Python slint package imports the slint_dev_native extension from the version-matched slint-dev wheel to gain system-testing and MCP support. If that import raises ImportError (wheel present but its native binary will not load on this platform/interpreter), slint warns 'Could not load the slint-dev development binary: {error}' and falls back to the bundled lean release binary - so the dev features silently stay unavailable.","triggerScenarios":"SLINT_TEST_SERVER/SLINT_MCP_PORT set, slint-dev installed at exactly the slint version, but importlib.import_module('slint_dev_native') raises ImportError: missing or incompatible .so (wrong glibc/musl, unsupported platform), Python ABI mismatch after an interpreter upgrade, or a partially installed package.","commonSituations":"Alpine/musl or older-glibc CI images with no matching manylinux wheel; upgrading Python without reinstalling slint-dev; macOS x86_64 vs arm64 wheel mismatch; pip installs with --no-binary or interrupted installs.","solutions":["Surface the real cause first: run python -c \"import slint_dev_native\" and read the underlying ImportError (missing symbol, wrong ELF class, ...).","Reinstall the matched pair from the same release: pip install --force-reinstall slint==X.Y.Z slint-dev==X.Y.Z.","Move to a platform that has published slint-dev wheels (standard glibc Linux, standard macOS) if the platform is unsupported.","If dev features are not actually needed in that run, unset SLINT_TEST_SERVER/SLINT_MCP_PORT so the lean release binary is used deliberately."],"exampleFix":"# before: warning 'Could not load the slint-dev development binary: ...'\npython -c \"import slint_dev_native\"   # shows the real ImportError\n\n# after: same-version pair reinstalled on a supported platform\npip install --force-reinstall slint==1.X.Y slint-dev==1.X.Y","handlingStrategy":"fallback","validationCode":"import importlib.util, importlib.metadata as md\n\ndef dev_binary_loadable() -> bool:\n    if importlib.util.find_spec(\"slint_dev_native\") is None:\n        return False\n    try:\n        return md.version(\"slint-dev\") == md.version(\"slint\")\n    except md.PackageNotFoundError:\n        return False\n\n# assert in test bootstrap so MCP/system-testing cannot silently go missing\nassert dev_binary_loadable(), \"install matching slint-dev for dev features\"","typeGuard":null,"tryCatchPattern":"try:\n    import slint_dev_native  # noqa: F401\n    dev_ok = True\nexcept ImportError as e:\n    dev_ok = False  # slint falls back to the lean release binary\n    warnings.warn(f\"dev binary unavailable: {e}\")","preventionTips":["Pin slint and slint-dev to the same exact version in the lockfile","Reinstall both together after any Python or package upgrade","Run on platforms with published slint-dev wheels (standard glibc Linux, macOS)","Assert dev availability in the test bootstrap when SLINT_MCP_PORT/SLINT_TEST_SERVER is set"],"tags":["python","native-module","slint-dev","import","mcp"],"backgroundTag":"native-module-import-failure","analyzedSha":"3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016","analyzedAt":"2026-08-19T23:23:16.610Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}