pybind / pybind/pybind11

[BUG] Embedding documentation is wrong

Open
#2,855 27 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
18k
Forks
2.3k
Avg merge
5d 17h
Merged PRs (30d)
10

Description

The lack of instruction in the pybind11 documentation of the proper methods for embedding python in C++ have cost me DAYS in my project, and it's still not working. You really do need to expand on this and give examples that actually work. There is no reason to include lines for a CMake file, which seems to only be necessary for embedding, when you know the code given doesn't work. I was able to call C++ from python using cppimport within minutes, but after more than a week I still can't print 'Hello World' from python in C++. This is a glaring mistake and should be corrected.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the pybind11 embedding documentation and its CMake example, then reproduce the documented C++-from-Python workflow. Compare the example with the reported failure and update the instructions with working embedding guidance and examples; done means a reader can follow them to print “Hello World” from Python in C++.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, python
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.