View my account

I couldn't import librealsense2

Comments

4 comments

  • Abdullaherzin80

    I'm sorry I forgot to say i have a D405 camera

    0
    Comment actions Permalink
  • MartyG

    Hi Abdullaherzin80  It is rare that the pyrealsense2.pyrealsense2 instruction is used.  It is more common to use import pyrealsense2 as rs

     

    Does the script work if you only have one pyrealsense2 in your import instruction?

    0
    Comment actions Permalink
  • Abdullaherzin80

    I already used import pyrealsense2 as rs in in the python file. The error caused because of the __init__.py at the /usr/local/lib/python3.10/pyrealsense2 location. I saw some suggestion at realsense github issues, so i copy the __init__ file into the that directory. If i remove the __init__ file from /usr/local/lib/python3.10/pyrealsense2, I got error like "Attribute error: module 'pyrealsense2' has no attribute 'pipeline' at ths line:

    pipeline = rs.pipeline()

    there is no error while importing pyrealsense2 like import pyrealsense2 as rs but i can't use any of the pyrealsense function, even this:

    print(rs.__version__)

    0
    Comment actions Permalink
  • MartyG

    If you are using a Linux computer then the two .so files to copy to the same folder as your project script are librealsense2.so and pyrealsense2.so.  If the folder image above is from your Jetson Nano then I can see a librealsense2.so file in the folder but not pyrealsense2.so.

     

    Building the pyrealsense2 wrapper for Python 3.10 from source code is fine, and your JetPack 4.4 version is compatible with the RealSense SDK.

    0
    Comment actions Permalink

Please sign in to leave a comment.