{"library":"pybind11-global","title":"Pybind11 (global install marker)","description":"Pybind11 is a C++ header-only library that provides seamless interoperability between C++ and Python, enabling the creation of Python bindings for C++ code and vice versa. The `pybind11-global` PyPI package, version 3.0.3, typically serves as a marker or a convenient way to ensure the necessary pybind11 C++ headers are discoverable for projects building Python extensions. Pybind11 maintains an active release cadence, with major versions introducing significant features and ABI bumps, followed by patch releases for bug fixes and compatibility updates.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install pybind11-global"],"cli":null},"imports":["import pybind11\n# ... then use pybind11.get_include() in your setup.py"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import setuptools\nimport pybind11\nimport os\n\n# This part makes the quickstart runnable by creating a dummy C++ source file.\n# In a real project, this file would exist independently.\ncpp_source_code = \"\"\"\n#include <pybind11/pybind11.h>\n#include <pybind11/stl.h> // Optional: for STL containers\n\nnamespace py = pybind11;\n\nint add(int i, int j) {\n    return i + j;\n}\n\nstd::vector<int> square_list(const std::vector<int>& input) {\n    std::vector<int> result;\n    for (int x : input) {\n        result.push_back(x * x);\n    }\n    return result;\n}\n\nPYBIND11_MODULE(my_module, m) {\n    m.doc() = \"pybind11 example plugin\"; // optional module docstring\n\n    m.def(\"add\", &add, \"A function which adds two numbers\");\n    m.def(\"square_list\", &square_list, \"Squares elements of an integer list\");\n}\n\"\"\"\n\ncpp_file_name = \"my_module.cpp\"\nif not os.path.exists(cpp_file_name):\n    with open(cpp_file_name, \"w\") as f:\n        f.write(cpp_source_code)\n\n# Standard setup.py for a pybind11 extension\nsetuptools.setup(\n    name=\"my_pybind11_package\",\n    version=\"0.0.1\",\n    author=\"Checklist.day\",\n    description=\"A minimal pybind11 example buildable via setup.py\",\n    ext_modules=[\n        setuptools.Extension(\n            \"my_module\", # Name of the Python module\n            [cpp_file_name],\n            include_dirs=[pybind11.get_include()], # Get pybind11 headers\n            language='c++',\n            extra_compile_args=[\"-O3\", \"-Wall\", \"-std=c++17\"],\n        ),\n    ],\n    zip_safe=False,\n    python_requires=\">=3.8\",\n)\n\nprint(f\"To build and install: python {os.path.basename(__file__)} install\")\nprint(\"Then, in Python: import my_module; print(my_module.add(1, 2)); print(my_module.square_list([1,2,3]))\")","lang":"python","description":"This quickstart provides a `setup.py` script that defines a simple Python extension module written in C++ using pybind11. To run it, save the code as `setup.py` in a directory, then open a terminal in that directory and execute `python setup.py install`. This will compile the C++ code and install the `my_module` package into your Python environment. After installation, you can open a Python interpreter and import `my_module` to use its `add` and `square_list` functions.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"3.0.4","pypi_latest":"3.0.4","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.6,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pybind11-global","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"17.8M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pybind11-global","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"18M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pybind11-global","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"19.6M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pybind11-global","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"20M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pybind11-global","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.5M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pybind11-global","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pybind11-global","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.2M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pybind11-global","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.5,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pybind11-global","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"17.3M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pybind11-global","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.8,"import_time_s":null,"mem_mb":null,"disk_size":"18M"}]}}