-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Realsense with Python3 #20
Comments
Hi @far-command-man, Thanks for flagging this. The problem is actually directory structure related. The python libs install to "/usr/lib/python3.x/site-packages/pyrealsense2" which isn't in the PYTHON_PATH. If the libs are moved up one level to "site-packages" everything works as expected. I will get it fixed! Thanks. |
@srware I checked out the "/usr/lib/python3.x/site-packages/pyrealsense2" and found pyrealsense shared object libraries there. I placed them under site-packages/ directory now everything works fine but of course the best way is to get them installed in respective directory originally. Thanks for the help! :) |
Should be fixed now. Thanks. |
I'm not sure this is the correct solution to the problem. Putting the shared libraries in site-packages can (although is unlikely to) interfere with other packages. The correct solution would be to copy the |
Hi, thanks tpwrules, this worked. After compiling librealsense (using cmake .. -DBUILD_PYTHON_BINDINGS:bool=true), i had the same issue when importing pyrealsense2 in python3. However, your package is not necessarily in site-packages. You need to first identify where your pyrealsense2 is: Then copy the
EDIT: typo |
@persalteas instructions worked for me, there is a typo in his last line though:
|
@persalteas
|
Hi edwin, |
I did that with the double underscores. It's just that when I copied it here it disappeared. |
@edwin9610 , I just tried to replicate this building an image from 'master' but it worked fine for me. I am assuming the pyrealsense2 library is being found in the path given it doesn't fail at the import stage. I have now incorporated the recommendations in this thread into the master branch so maybe give it another go. Thanks. |
@srware Hi, sorry for the late reply. I have these directories to the path. jetson@jetson-desktop:~$ python -c "import sys; print(sys.path)" as shown in the following screenshots. But I still have the problem with this: What should I do now? |
I'm getting the same error as @edwin9610 , is there any solution? Thank you in advance! |
In @edwin9610 's case, since the @punchnami do you have the package installed somewhere ? Check that the folder contains that |
Thank you @persalteas , I will check it out! |
After "sudo cp ~/librealsense/wrappers/python/pyrealsense2/init.py /usr/lib/python3.6/dist-packages/pyrealsense2/" and then copying the additional 6 .so files into /usr/lib/python3.6/dist-packages/pyrealsense2/ aswell When using import pyrealsense2 I still get the following error:
Anything that I am missing? |
Hi @srware ,
After your last commit, it is now possible to use T265/D435 with C++ code properly. However, I recently ran into a new issue. I follow the instructions given in README to add Python3 support in my image. I can import pyrealsense2 without any issue but it runs into an error once I declare RealSense sensor pipeline such as pipe = rs.pipeline(). It says AttributeError: module 'pyrealsense2' has no attribute 'pipeline'.
I saw this issue IntelRealSense/librealsense#4483 (comment) . The error messages we have looks the same but I am not sure how to resolve it in Yocto. Any help from your side is much appreciated.
The text was updated successfully, but these errors were encountered: