--- id: find-libpython version: "0.5.1" license: MIT license_treatment: permissive maintenance: active --- # find-libpython — Finds the libpython associated with your environment, wherever it may be hiding License: permissive · Maintenance: active · Downloads: 986.9K/mo ## 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 above — 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 pip install find-libpython uv add find-libpython poetry add find-libpython ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 986.9K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags find libpython path, libpython location, python library linking, embed python interpreter, libpython dynamic library, python c api linking, find python library, build-system, c-interop, cross-platform [View on SkillFed](https://skillfed.io/packages/find-libpython) · [View on PyPI](https://pypi.org/project/find-libpython/)