Registry / devops / findlibs

findlibs

JSON →
library0.1.3pypypi✓ verified 23d ago

FindLibs is a Python package designed to search for shared libraries across various platforms. It offers a robust search algorithm that includes checking Python module packages, system prefixes, environment variables, user-defined configuration files, and standard system paths. The current version is 0.1.2. It appears to be actively maintained by ECMWF, with regular updates and engagement on GitHub issues.

pip install findlibs
INSTALL
IMPORT
SIG · FINDLIBS
F
findlibs
devopspythonv0.1.3
Install
1.6s avg
Import
77ms
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.1.3 · 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.95 runs
installs and imports cleanly · install 0.0s · import 0.076s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.078s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

find
from findlibs import find

This quickstart demonstrates how to import the `find` function and use it to locate a shared library by its base name. The function returns the full path to the library if found, otherwise `None`. You can optionally provide `pkg_name` if the library is associated with a specific Python package name different from the library's base name.

from findlibs import find # Example: Try to find a common library like 'eccodes' # Replace 'eccodes' with a library relevant to your system if it's not found lib_path = find("eccodes") if lib_path: print(f"Found library at: {lib_path}") else: print("Library not found.") # You can also specify a package name if it differs from the library name # lib_path_with_pkg = find("mylib", pkg_name="my_python_package") # if lib_path_with_pkg: # print(f"Found 'mylib' via 'my_python_package' at: {lib_path_with_pkg}")
Debug
Known issues
breakingVersions 0.1.0 and later of `findlibs` utilize Union type expressions, which are only supported in Python 3.10 and newer. However, the package classifiers on PyPI may incorrectly allow installation on Python versions as low as 3.6, 3.7, and 3.8. Attempting to use `findlibs` on Python < 3.10 will lead to runtime errors.
fix
Ensure your Python environment is version 3.10 or higher. If you must use an older Python, you may need to pin `findlibs` to an earlier version if one exists that supports it (though none are explicitly stated to do so in the search results) or consider using an alternative library. Update your `pyproject.toml` or `requirements.txt` to specify `python_version >= '3.10'` for `findlibs`.
affects: >=0.1.0
gotchaWhile `findlibs` uses a comprehensive search strategy, its fallback mechanism includes `ctypes.util.find_library`. This underlying function is based on heuristics, which can be unreliable and prone to breaking changes or misleading results, especially on non-standard or newer Linux configurations (e.g., musl, Nix, AppImage) or platforms where Python's dynamic linker behavior doesn't align with system tools. The Python core development team is considering a 'soft deprecation' of `ctypes.util.find_library` in Python 3.15, indicating it will not be further developed and users should consider alternatives for robust library finding.
fix
Be aware that library detection, especially as a last resort, might fail or be incorrect. If `findlibs` cannot locate a library, manually provide the path through environment variables (e.g., `LD_LIBRARY_PATH`, `DYLD_LIBRARY_PATH`, `PKG_NAME_HOME`/`_DIR`) or a `~/.findlibs` configuration file, as these take precedence in `findlibs`'s search algorithm.
affects: All versions of `findlibs` that rely on `ctypes.util.find_library` (which appears to be all versions based on the README).
gotchaUsers on Ubuntu 20.04 and 24.04 have reported issues where `findlibs 0.1.0` returns an empty path for libraries like `eccodes.so`, even when the library is expected to be present. This indicates potential platform-specific issues with the search algorithm or expected library naming conventions on certain Linux distributions.
fix
If `findlibs` fails to locate a library on Linux, verify the library's actual location and exact filename. Utilize `findlibs`'s configurable search paths, such as setting `PKG_NAME_HOME` or `PKG_NAME_DIR` environment variables (e.g., `ECCODES_HOME`), or defining paths in `~/.findlibs` or `~/.config/findlibs/findlibs.conf`, to explicitly guide `findlibs` to the library's directory.
affects: 0.1.0 (and potentially later versions due to underlying platform differences)
Errors
Common errors & fixes
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
Findlibs versions 0.1.0 and later utilize Union type expressions, which are only supported in Python 3.10 and newer, leading to runtime errors if installed on older Python versions.
fix
Ensure your Python environment is version 3.10 or higher. You may need to upgrade Python or switch to a compatible virtual environment. If using `requirements.txt` or `pyproject.toml`, specify `python_version >= '3.10'` for findlibs.
ModuleNotFoundError: No module named 'findlibs'
The 'findlibs' package is not installed in the current Python environment, or the environment is not activated or correctly configured for Python to locate the module.
fix
Install the package using `pip install findlibs`. If working within a virtual environment, ensure it is activated before installing and running your code.
RuntimeError: Cannot find the ecCodes library
This error occurs when a dependent library (like `cfgrib` in this example) uses `findlibs.find()` to locate a shared library (e.g., 'eccodes') but `findlibs` returns `None`, indicating the library could not be found on the system. This can be due to the library being absent, in a non-standard location, or platform-specific issues with `findlibs`'s search algorithm.
fix
Verify that the required shared library (e.g., `libeccodes.so` or `eccodes.dll`) is installed and note its exact path. Explicitly guide `findlibs` by setting relevant environment variables (e.g., `ECCODES_HOME`, `LD_LIBRARY_PATH`, `DYLD_LIBRARY_PATH`) or by configuring `~/.findlibs`. Alternatively, handle the `None` return from `findlibs.find()` in your code to provide a more specific error or fallback.
Upgrade
Version history
0.1.3latest on PyPI · released Jul 14, 2026
Audit
Dependencies
pythonrequiredRequires Python 3.10 or higher due to the use of Union type expressions.
Agent activity
7 hits · last 30 days
node
6
Resources
findlibs — pip install findlibs · libregistry