{"record":{"id":"693d2753dd7d394c","repo":"kovidgoyal/kitty","slug":"exe-does-not-exist","errorCode":null,"errorMessage":"{exe} does not exist","messagePattern":"(.+?) does not exist","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"kitty/entry_points.py","lineNumber":78,"sourceCode":"    sys.argv = args[1:]\n    try:\n        exe = args[1]\n    except IndexError:\n        raise SystemExit(\n            'usage: kitty +launch script.py [arguments to be passed to script.py ...]\\n\\n'\n            'script.py will be run with full access to kitty code. If script.py is '\n            'prefixed with a : it will be searched for in PATH. If script.py is a directory '\n            'the __main__.py file inside it is run just as with the normal Python interpreter.'\n        )\n    if exe.startswith(':'):\n        import shutil\n\n        q = shutil.which(exe[1:])\n        if not q:\n            raise SystemExit(f'{exe[1:]} not found in PATH')\n        exe = q\n    if not os.path.exists(exe):\n        raise SystemExit(f'{exe} does not exist')\n    runpy.run_path(exe, run_name='__main__')\n\n\ndef shebang(args: list[str]) -> None:\n    from kitty.constants import kitten_exe\n\n    os.execvp(kitten_exe(), ['kitten', '__shebang__', 'confirm-if-needed'] + args[1:])\n\n\ndef run_kitten(args: list[str]) -> None:\n    try:\n        kitten = args[1]\n    except IndexError:\n        from kittens.runner import list_kittens\n\n        list_kittens()\n        raise SystemExit(1)\n    sys.argv = args[1:]","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/entry_points.py#L60-L96","documentation":"Raised by kitty's `launch` entry point when the executable path given (typically via `kitty +launch` or a kit that delegates to a script) does not exist on disk. It is a SystemExit with a clear message, emitted right before runpy would attempt to execute the file.","triggerScenarios":"Calling kitty/entry_points.py:launch(exe) where exe is not a `!`-prefixed PATH lookup (that case is handled earlier) and os.path.exists(exe) is False — e.g. passing a relative path from a different cwd, a typo'd path, or a deleted script.","commonSituations":"Custom kitten/launch scripts referenced by absolute path that was moved or is on a different machine; running kitty from a wrapper that computes the script path incorrectly; NFS/sshfs mounts not yet available.","solutions":["Verify the path exists from the same cwd kitty runs in (ls the exact value passed).","If the script should be found on PATH, prefix it with '!' so the earlier shutil.which branch resolves it.","Fix the wrapper/config that constructs the path (expanduser/expandvars, absolute paths)."],"exampleFix":"// before\nkitty +launch /opt/scripts/init.py  # path moved\n// after\nkitty +launch /opt/scripts-new/init.py\n# or rely on PATH lookup:\nkitty +launch '!my-init-script.py'","handlingStrategy":"validation","validationCode":"import os\nif not os.path.exists(exe):\n    raise FileNotFoundError(exe)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefix PATH-based executables with '!' to use kitty's which() resolution.","Use absolute paths produced by os.path.abspath in wrappers."],"tags":["kitty","file-not-found","entry-point","cli"],"backgroundTag":"file-path-not-found","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}