find-libpython

0.5.1 · active · verified Wed Apr 15

find-libpython is a Python library and script designed to robustly locate the `libpython` dynamic shared library associated with the current Python environment. It supports various Python installations, including conda-managed, system-managed, and virtual environments, across Windows, macOS, and Linux. This utility is crucial for projects embedding a Python interpreter or for Python library build systems that need to link against `libpython`. The current version is 0.5.1, released on February 10, 2026, with an active, though irregular, release cadence.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import and use the `find_libpython` function to locate the shared library. It returns the path as a string or `None` if not found.

from find_libpython import find_libpython

lib_path = find_libpython()
if lib_path:
    print(f"Found libpython at: {lib_path}")
else:
    print("Could not find libpython for the current environment.")

view raw JSON →