View my account

D455 is not detected in python code

Comments

7 comments

  • MartyG

    Hello, have you installed the pyrealsense2 Python compatibility wrapper on your RK3588 computer, please?  If you have not then adding the parameter below to line 46 of the libuvc_installation.sh libuvc backend installation script will build the pyrealsense2 wrapper at the same time that RealSense SDK 2.0 (librealsense) is built.

    -DBUILD_PYTHON_BINDINGS:bool=true 

     

    If you have installed the pyrealsense2 wrapper then please try running your Python program script with sudo admin permissions.  For example:

    sudo python3 test.py

     

    0
    Comment actions Permalink
  • 405275935

    Yes, I recompiled and reinstalled pyrealsense2. However, when running , the error "module has no attribute 'pipeline'" appears.rs.pipeline()

    0
    Comment actions Permalink
  • MartyG

    Thank you.  Next, please try changing the pyrealsense import line from this:

    import pyrealsense2 as rs

    to this:

    import pyrealsense2.pyrealsense2 as rs
    0
    Comment actions Permalink
  • 405275935

    it doesn't work,you can see ,under the pyrealsense2 is  pyrsutils.cpython-310-aarch64-linux-gnu.so,it maybe wrong.

    0
    Comment actions Permalink
  • MartyG

    The filenames look okay.  'aarch64' means that pyrealsense2 was built from source code on a computing device with an Arm processor chip (the RK), and 'cpython-310' means that it is being used with Python 3.10.

     

    The change to the pyrealsense2 import instruction is often what fixes the 'pipeline' attribute error.  

     

    What happens if you input the command below into the terminal before you run your script?

    export PYTHONPATH=$PYTHONPATH:/usr/local/lib
    0
    Comment actions Permalink
  • 405275935

    thanks,problems is solved by copying those files: pyrealsense2.cpython-310-aarch64-linux-gnu.so,pyrealsense2.cpython-310-aarch64-linux-gnu.so.2.55,pyrealsense2.cpython-310-aarch64-linux-gnu.so.2.55.1 from  librealsense/build/release   to  /usr/lib/python3/dist-packages. By the way,My English is really poor. Thank you again for your understanding and response. Wishing you a pleasant day at work!

    0
    Comment actions Permalink
  • MartyG

    Your English has been very good, so don't worry.  :)  It's excellent to hear that you achieved a solution.  Thanks very much for the update!

    0
    Comment actions Permalink

Please sign in to leave a comment.