# find_runtime
URL: https://lsd.tools/docs/api-runtime-find-runtime
Updated: 2026-07-17

## Parameters

| name | type | default | description |
|---|---|---|---|
| `env` | `Optional[Mapping[str, str]]` | `None` | environment to search; defaults to `os.environ`. Pass a dict to override (used in tests) |

## Example

```python
from lsdtools import find_runtime

rt = find_runtime()
if rt is None:
    raise SystemExit("LSD is not installed")
print(rt.executable)
```

Override the environment (e.g. in tests):

```python
rt = find_runtime({"LSD_RUNTIME": r"C:\LSD Desktop"})
```

## Notes

Search order, first hit wins: the `LSD_RUNTIME` / `LSD_HOME` env vars, Windows registry uninstall
entries named "LSD Desktop", well-known install dirs (`%ProgramFiles%\LSD Desktop` …), then an
`LSDCli` / `LSDDesktop` executable on `PATH`. Returns `None` when nothing matches. Cross-platform
safe — the registry step is skipped off Windows.

## See also

**API:** [Runtime](/docs/api-runtime) · [source](/docs/api-runtime-source) · [executable](/docs/api-runtime-executable)

**Guides:** [Install LSD](/docs/start-install) · [CLI commands](/docs/api-cli)
