find-libpython
Finds the libpython associated with your environment, wherever it may be hiding
What it is and what it does
find_libpython is a utility that discovers the path to the libpython shared library for your current Python environment. It handles the complexity of locating libpython across different installation methods—conda, system package managers, custom builds—and different operating systems. The package works both as a command-line tool (useful in makefiles and build scripts) and as a Python library (useful in distutils-based build systems or Python code that embeds a Python interpreter).
The main use case is enabling other projects to link against or embed Python without hardcoding library paths. It abstracts away platform-specific search logic and installation variations, returning either the path as a string or None if the library cannot be found. No external dependencies are required, making it lightweight to integrate into build toolchains.
Use it for:
- Embed a Python interpreter in a C/C++ application by discovering the correct libpython to link against.
- Build Python extension modules in makefile-based systems by querying the script for the libpython path.
- Automate library path resolution in distutils or setuptools-based build systems across multiple platforms.
- Locate libpython in conda environments or custom Python installations for FFI bindings.
- Debug Python installation issues by inspecting candidate library names and paths via CLI flags.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Locates the libpython dynamic library path for the current Python environment, working across conda, system, and custom installations on Windows, macOS, and Linux.
Yes. The package solves a genuine cross-platform problem with no dependencies, active maintenance, and a permissive license. Install it if you need to locate libpython for embedding, linking, or build automation. The low friction and clear scope make it a safe addition to build toolchains.
Install
find-libpython on PyPI
pip
pip install find-libpythonuv
uv add find-libpythonpoetry
poetry add find-libpythonInstalling find-libpython
Before you install
Low install friction with no runtime dependencies. Actively maintained with a recent release and steady repository activity.
License in practice
MIT license permits commercial and private use with minimal restrictions; attribution required.
Quickstart
pip install find-libpython
from find_libpython import find_libpython
path = find_libpython()
print(path) # e.g., /home/user/miniconda3/envs/test/lib/libpython3.8.so.1.0
Requires Python 3.9 or later.
Verify before relying
- Whether the package successfully locates libpython in all edge-case installations (e.g., static builds, non-standard layouts).
- Performance characteristics when called repeatedly or on systems with many candidate paths.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 184 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 986,854/month — #4,572 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: find_libpython-0.5.1-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
python-discoveryDiscovers Python interpreters installed on your…
permissive · top 1,000 on PyPI
libusb-packageBundles libusb shared libraries for multiple…
permissive · top 5,000 on PyPI
dllistLists the shared libraries (DLLs) currently…
permissive · top 15,000 on PyPI
dlinfoProvides Python access to libc's dlinfo…
permissive · top 5,000 on PyPI
ptpythonptpython is an advanced interactive Python…
permissive · top 5,000 on PyPI
cppyy-clingProvides Cling, an LLVM-based interactive C++…
copyleft · top 15,000 on PyPI
whichcraftProvides a cross-platform, cross-Python…
permissive · top 15,000 on PyPI
juliacallCall Julia code from Python and Python code…
permissive · top 15,000 on PyPI
findlibsLocates shared libraries on the system by…
permissive · top 5,000 on PyPI
nbsphinx-linkA Sphinx extension that lets you include…
permissive · top 15,000 on PyPI