{"id":8159,"library":"find-exe","title":"Find Executable","description":"Find Executable (find-exe) is a Python library and command-line interface designed to locate matching executables on a system given certain criteria. It provides a robust way to programmatically find executables, similar to the `which` or `where` commands, with additional flexibility. The current version is 0.2.1, and it maintains an active release cadence with minor updates and fixes.","status":"active","version":"0.2.1","language":"en","source_language":"en","source_url":"https://github.com/ofek/find-exe","tags":["executable","path","utility","cli","system"],"install":[{"cmd":"pip install find-exe","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"find_exe","correct":"import find_exe"}],"quickstart":{"code":"import find_exe\n\n# Find 'python' executable in the system's PATH\npython_exe = find_exe.which('python')\nprint(f\"Python executable: {python_exe}\")\n\n# Find executables starting with 'py'\n# Note: This might return different paths depending on your system configuration.\npy_executables = find_exe.with_prefix('py')\nprint(f\"Executables with prefix 'py': {py_executables[:3]}...\")\n\n# Find a specific executable in custom paths\ncustom_paths = ['/usr/local/bin', '/opt/some_app/bin'] # Example paths\ngit_exe_custom = find_exe.which('git', paths=custom_paths)\nprint(f\"Git executable in custom paths: {git_exe_custom}\")","lang":"python","description":"The quickstart demonstrates finding executables using `find_exe.which()` and `find_exe.with_prefix()`. It also shows how to specify custom search paths using the `paths` argument."},"warnings":[{"fix":"Upgrade to `find-exe` version 0.2.1 or later to resolve potential case sensitivity problems on Windows. Use `pip install --upgrade find-exe`.","message":"Prior to version 0.2.1, `find-exe` could experience case sensitivity issues on Windows, especially when the `PATHEXT` environment variable was explicitly defined. This could lead to executables not being found or unexpected results.","severity":"gotcha","affected_versions":"<0.2.1"},{"fix":"For predictable results, ensure your system's `PATH` and `PATHEXT` variables are correctly configured. If using the `paths` argument, provide an explicit list of directories to search. If still facing issues, check `os.environ['PATH']` and `os.environ.get('PATHEXT', '')` within your Python environment.","message":"When using `find_exe.which()` or `find_exe.with_prefix()` on Windows, the order of directories in your system's `PATH` environment variable and the values in `PATHEXT` (file extensions to consider as executables) significantly influence the results. Be aware that the behavior might differ from Linux/macOS systems or even from Windows' native `where` command if `PATHEXT` is customized or incomplete.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Verify the executable's location and permissions. If it's not in a standard PATH directory, use the `paths` argument: `find_exe.which('my_executable', paths=['/path/to/dir'])`. For Windows, ensure the executable's extension (e.g., '.exe', '.bat') is included in your system's `PATHEXT` variable or that you specify the full executable name including extension.","cause":"The specified executable is either not in the system's PATH, not in the custom `paths` provided, or lacks execute permissions for the current user. On Windows, it might also be due to an unrecognized file extension (not in PATHEXT).","error":"find_exe.which('my_executable') returns None unexpectedly"},{"fix":"Upgrade your `find-exe` library to version 0.2.0 or newer: `pip install --upgrade find-exe`.","cause":"The `paths` argument was introduced in version 0.2.0. This error indicates you are using an older version of `find-exe`.","error":"TypeError: which() got an unexpected keyword argument 'paths'"}]}