Closed petrasvestartas closed 5 months ago
".so"(on linux) and ".pyd"(on windows) files are basically the same. Have you tried import NanoTest
?
@a603032070 Yes I tried, no module found.
I changed binding name to my_ext
to be inline with the example. I checked on my system I have python 3.11.
I also tried to give a path directly to the .so file:
import sys
sys.path.append('/home/petras/brg/2_code/ShapeOp/build/')
import my_ext
Still the same error.
I removed any 3rd party libraries and just left nano, could you check my repository: https://github.com/petrasvestartas/ShapeOp
@a603032070 Yes I tried, no module found. I changed binding name to
my_ext
to be inline with the example. I checked on my system I have python 3.11.I also tried to give a path directly to the .so file:
import sys sys.path.append('/home/petras/brg/2_code/ShapeOp/build/') import my_ext
Still the same error.
I removed any 3rd party libraries and just left nano, could you check my repository: https://github.com/petrasvestartas/ShapeOp
I've checked your repo. It works well. Maybe something wrong about the path(or permissions)?
@a603032070
The issue is in python version. In my base environment with python 3.11 it works. But with my conda environment where python is 3.9 it does not.
How you can specify in CMakelists which python version the library is built for?
I don't really know. Maybe it's about this line in Cmakelists.
find_package(Python 3.9 COMPONENTS Interpreter Development.Module REQUIRED)
ExternalProject_Add
is not a supported way of dealing with the nanobind dependency, I don't use it and cannot provide support for it.
I also suspect you are working partly on windows and on Linux (WSL?), hence the confusion about .pyd
and .so
files which are for different operating systems.
Anyways, these are all not bugs bug issues with your setup. Please don't open tickets here unless you are certain to have found a bug in nanobind.
Problem description
This is my CMakeLists.txt that downloads Nanobind and build the main.cpp example file with the documentation sourcecode. Why does cmake output
NanoTest.cpython-311-x86_64-linux-gnu.so
but not the .pyd file?This is my sourcecode:
I run it like this:
Reproducible example code
No response