sizmailov / pybind11-stubgen

Generate stubs for python modules
Other
228 stars 45 forks source link

Can't find/import 'flags.writable' #127

Closed kingjin94 closed 11 months ago

kingjin94 commented 11 months ago

Hi there,

After the recent update to version 1.2 sadly my PyBind11 code is no longer handled properly by pybind11_stubgen and throws this error:

pybind11_stubgen - [ ERROR] In mcs.utilities.kunz_trajectory : Can't find/import 'flags.writeable'

Does any one have an idea how to debug this? The error sadly seems to be not within the pybind11-stubgen codebase. Looking into the .so file of the given module it seems to be related to numpy arrays being passed to and from the PyBind11 code. Might that be a reason for this error?

sizmailov commented 11 months ago

Thanks for the report!

The error comes from a representation of numpy array in pybind https://github.com/search?q=repo%3Apybind%2Fpybind11%20flags.writeable&type=code

I'll add a patch shortly.