Closed HendrikHuebner closed 4 months ago
The module should be importable by python interpreter.
You should provide the module name, e.g. pybind11-stubgen libtest
.
Add the path to .so
file to PYTHONPATH
env variable.
Ah, adding it to $PYTHONPATH has solved the issue. Thanks.
I have a pybind module called
libtest.cpython-311-x86_64-linux-gnu.so
and I'm trying to use this tool to generate stubs for it. I can import "libtest" in a python file in the same folder and make calls to its functions but without the stub my IDE will mark everything as an error. Runningpybind11-stubgen libtest
orpybind11-stubgen libtest.cpython-311-x86_64-linux-gnu.so
just results in an error containing:ModuleNotFoundError: No module named 'libtest'
Am I using this tool correctly?