{"record":{"id":"6daeb304cf92026d","repo":"kovidgoyal/kitty","slug":"kitty-binary-not-found","errorCode":null,"errorMessage":"kitty binary not found","messagePattern":"kitty binary not found","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"kitty/constants.py","lineNumber":100,"sourceCode":"else:\n    kitty_base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n    extensions_dir = os.path.join(kitty_base_dir, 'kitty')\n\n\n@run_once\ndef kitty_exe() -> str:\n    rpath = kitty_run_data.get('bundle_exe_dir')\n    if not rpath:\n        items = os.environ.get('PATH', '').split(os.pathsep) + [os.path.join(kitty_base_dir, 'kitty', 'launcher')]\n        seen: set[str] = set()\n        for candidate in filter(None, items):\n            if candidate not in seen:\n                seen.add(candidate)\n                if os.access(os.path.join(candidate, 'kitty'), os.X_OK):\n                    rpath = candidate\n                    break\n        else:\n            raise RuntimeError('kitty binary not found')\n    return os.path.join(rpath, 'kitty')\n\n\n@run_once\ndef kitten_exe() -> str:\n    return os.path.join(os.path.dirname(kitty_exe()), 'kitten')\n\n\ndef _get_config_dir() -> str:\n    cdir = kitty_run_data.get('config_dir', '')\n    if cdir:\n        return str(cdir)\n    import atexit\n    import tempfile\n\n    ans = tempfile.mkdtemp(prefix='kitty-conf-')\n\n    def cleanup() -> None:","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/constants.py#L82-L118","documentation":"constants.kitty_exe locates the kitty binary by scanning candidate dirs; if none contains an executable named 'kitty' it raises RuntimeError('kitty binary not found'). Many helpers (kitten_exe, kitty_shell, exec_under_perf, docs) depend on it.","triggerScenarios":"kitty's python code running from a source checkout or unusual install where no runnable 'kitty' executable exists in the searched locations; or a broken package where the binary was stripped.","commonSituations":"Running kittens/tests from a git clone without building, pip/npm-style installs that omit the launcher, or PATH/venv setups that shadow kitty.","solutions":["Install kitty properly (make && sudo make install) so the binary exists next to the python code","Run from an installed kitty rather than a bare checkout","If developing, build the kitty binary in the checkout first","Ensure the kitty dir isn't stripped by packaging"],"exampleFix":"# before\n# running kitten from source clone without build\ngit clone kitty && kitten icat img.png\n# after\ncd kitty && make\n./kitten icat img.png","handlingStrategy":"fallback","validationCode":"import shutil\nkitty_ok = shutil.which('kitty') is not None","typeGuard":null,"tryCatchPattern":"from kitty.constants import kitty_exe\ntry:\n    exe = kitty_exe()\nexcept RuntimeError:\n    exe = shutil.which('kitty') or '/usr/local/bin/kitty'","preventionTips":["Install kitty via its official installer/make install","Build the binary when working from source","Cache kitty_exe() result once and fail fast with a clear message"],"tags":["kitty","binary-not-found","installation","runtime"],"backgroundTag":"executable-not-found","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}