pybind / pybind/pybind11

[BUG]: bindings that work from Python fail with "Cannot find class 'py.pybind11_builtins.pybind11_type'" when used from Matlab Python interface

Open
#3,945 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Required prerequisites
Problem description

Basic things like instantiation of a pybin11-exposed C++ class, that do work when called from Python, stop to work when called from the Matlab Python interface (through the same install pybind11-generated Python package). There is just a "Cannot find class 'py.pybind11_builtins.pybind11_type" error shown. Any clues on how to debug it or what is causing the error? Thanks!

Reproducible example code

Minimal reproducer with succeeding code/GH action in Python and failing GH action for Matlab here: https://github.com/slayoo/pybind_matlab_issue

OK Python: https://github.com/slayoo/pybind_matlab_issue/actions/runs/6911677790/job/18806501098
KO Matlab: https://github.com/slayoo/pybind_matlab_issue/actions/runs/6911677788/job/18806501100

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 linked pybind_matlab_issue reproducer and compare the successful Python GitHub Actions run with the failing Matlab run. Trace why the pybind11-generated package exposes py.pybind11_builtins.pybind11_type differently through Matlab's Python interface; done means identifying a reproducible cause and documenting or implementing a compatible fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, matlab, python
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.