-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: bindings that work from Python fail with "Cannot find class 'py.pybind11_builtins.pybind11_type'" when used from Matlab Python interface #3945
Comments
Fort the record, noting down here the reply from Gitter by @Holt59:
@acampbel could you help us here? The issue is that while using a C++-implemented package that works OK from Python, when loading it from Matlab, there is some problem loading share libraries as the symbols seem to have an additional "py." prefix that prevents them from being correctly located. The error message is: |
For the record, noting here down a comment from Gitter by @jeandet
|
@henryiii, @rwgk, let me take the liberty of "pinging" if you'd have any hints on how to workaround this issue, i.e. make pybind11-based packages usable under the Matlab Python interface? The issue is (with a minimalistic CI reproducer here: https://github.com/slayoo/pybind_matlab_issue - see also links above to logs of CI runs depicting the problem) that a correctly functioning pybind11-based Python module, when imported in Matlab throws:
Implying that Matlab seems to prefix the symbols with the bogus "py.". |
I briefly looked, but sorry, I don't have any hints. The logs will expire, I recommend you paste the critical messages here. It'll also make it more likely that others with the same problem find this bug (and then maybe you can stick your heads together to solve it). It's not certain (at all) that the problem is rooted in pybind11. If you reduce the problem to a pybind11 PR that fails in the pybind11 GHA I'll take another look.
|
Thank you, @rwgk!
voilà: pybind/cmake_example#164 |
For the record, a workaround for this problem was proposed by @rwgk at pybind/cmake_example#164 |
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
The text was updated successfully, but these errors were encountered: