About 51 results
Open links in new tab
  1. call a Python function from c++ using pybind11 - Stack Overflow

    The answer to your question really has two parts: one about calling a Python function from C++, the other about embedding the interpreter. Calling a function in pybind11 is simply a matter of getting …

  2. pyqt - Pybind11 cannot integrate with Qt 6.9.1 - Stack Overflow

    Aug 21, 2025 · I included Qt 6.9.1 header files and pybind11/pybind11.h in a same file. but then I use python to build a package.(the compiler is MSVC2022 x64 and I only use CMake) this is part of …

  3. How to call a python function from C++ with pybind11?

    Jan 25, 2022 · From the pybind11 point of view it's just a module with a dict, and you probably shouldn't be writing into it casually (unless you've really decided that you want to deliberately put something …

  4. No Module Named error when trying to run pybind11-stubgen

    Jan 23, 2025 · I've been scratching my head (googling, chatgpt-ing) trying to figure out why I can't generate a pyi file for a pybind module with pybind11-stubgen. I did this about a year ago …

  5. Force pybind11's stubgen to produce a Sequence type from an …

    Feb 7, 2024 · The TL;DR of the question really is - what is what a C++ interface should be for stubgen to recognize the API as a Sequence type. As stated clearly at the end, I am happy to alter the C++ …

  6. Pybind11 and std::vector -- How to free data using capsules?

    Feb 25, 2019 · I have a C++ function that returns a std::vector and, using Pybind11, I would like to return the contents of that vector as a Numpy array without having to copy the underlying data of the vector …

  7. Pybind11 - Multiple definition of PyInit_module_name

    Feb 25, 2025 · Solved! - Please check the answer. I wrote a library where headers and python bindings are auto-generated. For example dummy_bind.cpp for dummy_message.h and each _bind.cpp file …

  8. pybind11 for C++14/C++17 - Stack Overflow

    Sep 1, 2020 · 10 Does pybind11 work for C++14 and C++17 seamlessly ? I'm planning to use Boost.python for my project which is currently in C++11. In future I may have to upgrade to C++14 or …

  9. How to set python function as callback for c++ using pybind11?

    Jan 6, 2022 · PYBIND11_MODULE(example, m) { m.def("set_callback", [](Handler h) { handler = h; }); } If you have multiple ClientInterface instances, you can map ClientInterface pointers to handlers and …

  10. Extending a CMake-based C++ project to Python using Pybind11

    Mar 5, 2024 · I have a (large) C++ project built with CMake, and I am trying to use pybind11 on it. The targets include: to build and run an executable (like a normal C++ project); to call some C++ methods …