Registry / devops / find-exe

find-exe

JSON →
library0.2.1pypypi✓ verified 87d ago

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.

pip install find-exe
INSTALL
IMPORT
SIG · FIND-EXE
F
find-exe
devopspythonv0.2.1
Install
1.5s avg
Import
11ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.012s · 17.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.5s · import 0.008s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

find_exe
import find_exe

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.

import find_exe # Find 'python' executable in the system's PATH python_exe = find_exe.which('python') print(f"Python executable: {python_exe}") # Find executables starting with 'py' # Note: This might return different paths depending on your system configuration. py_executables = find_exe.with_prefix('py') print(f"Executables with prefix 'py': {py_executables[:3]}...") # Find a specific executable in custom paths custom_paths = ['/usr/local/bin', '/opt/some_app/bin'] # Example paths git_exe_custom = find_exe.which('git', paths=custom_paths) print(f"Git executable in custom paths: {git_exe_custom}")
find-exe --version
Debug
Known issues
gotchaPrior 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.
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`.
affects: <0.2.1
gotchaWhen 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.
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.
affects: All versions
Errors
Common errors & fixes
find_exe.which('my_executable') returns None unexpectedly
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).
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.
TypeError: which() got an unexpected keyword argument 'paths'
The `paths` argument was introduced in version 0.2.0. This error indicates you are using an older version of `find-exe`.
fix
Upgrade your `find-exe` library to version 0.2.0 or newer: `pip install --upgrade find-exe`.
Upgrade
Version history
0.2.1latest on PyPI · released Sep 24, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
find-exe — pip install find-exe · libregistry