Code Monkey home page Code Monkey logo

Comments (6)

a603032070 avatar a603032070 commented on June 2, 2024

".so"(on linux) and ".pyd"(on windows) files are basically the same. Have you tried import NanoTest?

from nanobind.

petrasvestartas avatar petrasvestartas commented on June 2, 2024

@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

from nanobind.

a603032070 avatar a603032070 commented on June 2, 2024

@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)?

from nanobind.

petrasvestartas avatar petrasvestartas commented on June 2, 2024

@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?

from nanobind.

a603032070 avatar a603032070 commented on June 2, 2024

I don't really know. Maybe it's about this line in Cmakelists.
find_package(Python 3.9 COMPONENTS Interpreter Development.Module REQUIRED)

https://cmake.org/cmake/help/latest/module/FindPython.html

from nanobind.

wjakob avatar wjakob commented on June 2, 2024

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.

from nanobind.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.