{"record":{"id":"e04a3948cb6eb27b","repo":"Unity-Technologies/ml-agents","slug":"no-extensions-found-for-this-platform","errorCode":null,"errorMessage":"No extensions found for this platform.","messagePattern":"No extensions found for this platform\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"ml-agents-envs/mlagents_envs/registry/binary_utils.py","lineNumber":89,"sourceCode":"    \"\"\"\n    Recursively searches for a Unity executable in the extracted files folders. This is\n    platform dependent : It will only return a Unity executable compatible with the\n    computer's OS. If no executable is found, None will be returned.\n    :param name: The name/identifier of the executable\n    :param url: The url the executable was downloaded from (for verification)\n    :param: tmp_dir: Optional override for the temporary directory to save binaries and zips in.\n    \"\"\"\n    _, bin_dir = get_tmp_dirs(tmp_dir)\n    extension = None\n\n    if platform == \"linux\" or platform == \"linux2\":\n        extension = \"*.x86_64\"\n    if platform == \"darwin\":\n        extension = \"*.app\"\n    if platform == \"win32\":\n        extension = \"*.exe\"\n    if extension is None:\n        raise NotImplementedError(\"No extensions found for this platform.\")\n    url_hash = \"-\" + hashlib.md5(url.encode()).hexdigest()\n    path = os.path.join(bin_dir, name + url_hash, \"**\", extension)\n    candidates = glob.glob(path, recursive=True)\n    if len(candidates) == 0:\n        return None\n    else:\n        for c in candidates:\n            # Unity sometimes produces another .exe file that we must filter out\n            if \"UnityCrashHandler64\" not in c:\n                # If the file is not valid, return None and delete faulty directory\n                if validate_environment_path(c) is None:\n                    shutil.rmtree(c)\n                    return None\n                return c\n        return None\n\n\ndef _get_tmp_dir_helper(tmp_dir: Optional[str] = None) -> Tuple[str, str]:","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/Unity-Technologies/ml-agents/blob/3ecb446f75d1e7400eb404c562dc005d3164cffc/ml-agents-envs/mlagents_envs/registry/binary_utils.py#L71-L107","documentation":"NotImplementedError raised by get_local_binary_path_if_exists when the current platform string has no known binary-extension mapping. Known platforms: linux -> *.x86_64, darwin -> *.app, win32 -> *.exe.","triggerScenarios":"Calling get_local_binary_path (via a remote registry entry's make()) on a platform other than linux/darwin/win32 — e.g. arm64-specific strings, freebsd, or a nonstandard sys.platform value.","commonSituations":"Running ML-Agents binary downloads on unsupported OS/arch (Apple Silicon where platform reports differently, Windows ARM, BSD); embedding the library in a tool that fakes sys.platform.","solutions":["Run on a supported platform (linux x86_64, macOS, Windows).","Extend binary_utils to map your platform to an extension (patch the if-chain) and rebuild/install locally.","Force a known platform value if your runtime's sys.platform is nonstandard but the OS is actually supported.","Avoid remote registry entries on the unsupported platform; provide the executable path manually via UnityEnvironment(file_name=...)."],"exampleFix":"// before\nif platform == \"linux\":\n    extension = \"*.x86_64\"\n// after\nif platform == \"linux\":\n    extension = \"*.x86_64\"\nelif platform.startswith(\"linux\"):\n    extension = \"*.x86_64\"  # cover linux-aarch64 etc.","handlingStrategy":"validation","validationCode":"import sys\nSUPPORTED = {\"linux\", \"darwin\", \"win32\"}\nif sys.platform not in SUPPORTED:\n    raise RuntimeError(f\"Binary registry unsupported on {sys.platform}\")\nentry.make()","typeGuard":"def is_supported_platform(platform: str) -> bool:\n    return platform in {\"linux\", \"darwin\", \"win32\"}","tryCatchPattern":"try:\n    env = entry.make()\nexcept NotImplementedError:\n    env = UnityEnvironment(file_name=manual_binary_path)","preventionTips":["Run binary-based envs only on linux/darwin/win32","Patch binary_utils for new platforms you must support","Prefer local file_name environments on unusual OS/arch"],"tags":["platform","registry","unsupported"],"backgroundTag":"unsupported-platform","analyzedSha":"3ecb446f75d1e7400eb404c562dc005d3164cffc","analyzedAt":"2026-09-02T16:33:12.832Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}