{"id":15009823,"url":"https://github.com/ktbarrett/find_libpython","last_synced_at":"2025-08-16T16:48:33.894Z","repository":{"id":43386992,"uuid":"279744405","full_name":"ktbarrett/find_libpython","owner":"ktbarrett","description":"Finds the libpython associated with the current Python environment, wherever it may be hiding.","archived":false,"fork":false,"pushed_at":"2024-03-13T17:00:07.000Z","size":57,"stargazers_count":15,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T21:02:26.265Z","etag":null,"topics":["build-system","embedding-python","libraries","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ktbarrett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-15T02:42:33.000Z","updated_at":"2024-12-28T20:28:26.000Z","dependencies_parsed_at":"2024-06-19T03:21:57.527Z","dependency_job_id":null,"html_url":"https://github.com/ktbarrett/find_libpython","commit_stats":{"total_commits":54,"total_committers":2,"mean_commits":27.0,"dds":"0.18518518518518523","last_synced_commit":"e6f9cb4547265e9aa01147dfcc66bcce8ec2762a"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktbarrett%2Ffind_libpython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktbarrett%2Ffind_libpython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktbarrett%2Ffind_libpython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktbarrett%2Ffind_libpython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ktbarrett","download_url":"https://codeload.github.com/ktbarrett/find_libpython/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248083229,"owners_count":21045060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-system","embedding-python","libraries","python3"],"created_at":"2024-09-24T19:28:48.229Z","updated_at":"2025-04-09T17:52:04.176Z","avatar_url":"https://github.com/ktbarrett.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# find_libpython\n\nA pypi project version of [this](https://gist.github.com/tkf/d980eee120611604c0b9b5fef5b8dae6) gist, which also appears\nwithin the [PyCall](https://github.com/JuliaPy/PyCall.jl/blob/master/deps/find_libpython.py) library.\n\nThe library is designed to find the path to the libpython dynamic library for the current Python environment.\nIt should work with many types of installations, whether it be conda-managed, system-managed, or otherwise.\nAnd it should function on Windows, Mac OS/OS X, and any Linux distribution.\n\nThis code is useful in several contexts, including projects that embed a Python interpreter into another process,\nor Python library build systems.\n\n## Usage\n\n`find_libpython` is both a script and a Python package.\nUsage as a script is useful in contexts like obtaining the path to libpython for linking in makefile-based build systems.\nIt could also be used to determine the path to libpython for embedding a Python interpreter in a process written in another language.\nIn that case the recommended usage is to simply call the script in a subprocess with no arguments and parse the output.\n\n```\n\u003e find_libpython\n/home/kaleb/miniconda3/envs/test/lib/libpython3.8.so.1.0\n```\n\nThe full help message:\n```\n\u003e find_libpython --help\nusage: find_libpython [-h] [-v] [--list-all | --candidate-names | --candidate-paths | --platform-info | --version]\n\nLocate libpython associated with this Python executable.\n\noptions:\n  -h, --help         show this help message and exit\n  -v, --verbose      Print debugging information.\n  --list-all         Print list of all paths found.\n  --candidate-names  Print list of candidate names of libpython.\n  --candidate-paths  Print list of candidate paths of libpython.\n  --platform-info    Print information about the platform and exit.\n  --version          show program's version number and exit\n```\n\nUsage as a library might occur when you need to obtain the path to the library in a Python-based build system like distutils.\nIt is recommended to use the `find_libpython` method which will return the path to libpython as a string, or `None` if it cannot be found.\n\n```python\n\u003e\u003e\u003e from find_libpython import find_libpython\n\u003e\u003e\u003e find_libpython()\n'/home/kaleb/miniconda3/envs/test/lib/libpython3.8.so.1.0'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktbarrett%2Ffind_libpython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fktbarrett%2Ffind_libpython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktbarrett%2Ffind_libpython/lists"}