View my account

Comments

7 comments

  • MartyG

    Hi, Step 5 is an optional step if you decide not to set a PYTHONPATH in Step 4.  If you prefer though to copy the librealsense2 and pyrealsense2 files next to your script, then you should place them in the same folder that your pyrealsense2 program script is located in. 

    For example, if I wrote a script called 'test.py' then the .so files would be copied into the same folder that I had put test.py in so that they are 'next to' the script..

    0
    Comment actions Permalink
  • B2992872

    I put all the files in the same folder and an error occurred

    0
    Comment actions Permalink
  • MartyG

    Can you confirm please that you did not set a PYTHONPATH in Step 4?  If you did, I wonder if Python is looking elsewhere other than your script folder for pyrealsense2.

    0
    Comment actions Permalink
  • B2992872

    I did the fourth step, this is the result in usr/local/lib

    0
    Comment actions Permalink
  • MartyG

    If you used export PYTHONPATH=$PYTHONPATH:/usr/local/lib then it looks as though the path was set correctly.  I notice though that there are 3 different versions of pyrealsense2.so in your usr/local/lib directory (the last 3 files of the image).  What you could try is moving the last 2 files - so.2 and so.2.13.0 - out of this directory into another folder on your desktop for safekeeping.  If moving these 2 files out does not make a difference, you can then at least easily move them back into usr/local/lib again.

    0
    Comment actions Permalink
  • B2992872

    I can't remove him, and if I use python2.7 instead of python3, will this be a mistake?

    0
    Comment actions Permalink
  • MartyG

    It is not wrong to use the pyrealsense2 wrapper with Python 2.7.  The majority of people just prefer using Python 3 if they have it installed because it is the most modern version of Python.   If you are satisfied to use the wrapper with Python 2.7 then that is not a problem. 

    0
    Comment actions Permalink

Please sign in to leave a comment.