"incompatible function arguments" when using python bindings on sonoma mac #515
Replies: 2 comments 2 replies
-
In C++,
I believe that in python,
I believe you may have intended By the way, an |
Beta Was this translation helpful? Give feedback.
-
Hmmm, I'm puzzled why this is not working. Sorry, I'm out of ideas and I have to run. Anyway, my experience is basically only Linux. |
Beta Was this translation helpful? Give feedback.
-
Hi, I've got a C++ project with python bindings through nanobind, including a function with signature
that I've been successfully using from python with the following pattern
Recently, when I updated nanobind I saw that a few things weren't compiling and that I needed to substitute
nb::any
->-1
. After making that small change to get things going again,my python tests are complaining that
func
is no longer callableI looked through the documentation to see if there was anything else I might be missing, and there's this note:
https://nanobind.readthedocs.io/en/latest/ndarray.html#why-does-nanobind-not-accept-my-numpy-array
So, I tried removing the
const
ness in the C++ code, and (separately) doingsetflags(write=false)
on the numpy arrays and was still unable to call this function (sameTypeError
message)Can anyone help me understand what I'm doing wrong with the recent version of nanobind?
Edit: after reverting to an older version of nanobind, I'm getting a similar error. It occurs to me, this is also my first time building this project on a new mac (w/ python 3.12 + numpy 1.26.4).
Beta Was this translation helpful? Give feedback.
All reactions