-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Module 'pyrealsense2' has no attribute 'pipeline' #6986
Comments
Hi @Kosta404 I see that Raspberry Pi OS is the new name for the Raspbian OS, and that Raspberry Pi OS should work with all Pi models, May I confirm that you are using the Pi 4 model please, as suggested by your acrobotic link? Thanks! |
@MartyG-RealSense Hello! Yes, I`m using Raspberry Pi 4. |
Thank you very much. I recall that the Acrobotic installation guide that you used is quite similar to Intel's official installation guide for the Pi 3 / 3b. https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_raspbian.md I notice that you said that you "reinstalled" the system. Have you had pyrealsense2 installed on your computer before, please? |
@MartyG-RealSense Yes, I`ve had it installed on Pi. But I reinstalled my system on a new SD-card. |
Unfortunately, getting pyrealsense2 to work on a Raspberry Pi can sometimes be an awkward process. I have a memory of a case where a Pi user installed it successfully, backed up their system to SD card and reinstalled from the card but pyrealsense2 no longer worked. It may be that your pyrealsense2 setup will have to be recreated the long way around (build librealsense, then build pyrealsense2). |
@MartyG-RealSense Don |
Okay, good luck! |
@MartyG-RealSense Hi again . I`ve reinstalled pyrealsense2 and librealsense packages. And built them again according to the official guide suggested above. That didn`t work. I have the same problem, not only pipeline function but all the pyrealsense2 functions are not available. |
Thank you very much for your patience. In the Pi instructions for building pyrealsense2, it provides two separate instructions for building pyrealsense2 for Python 2 and for Python 3. Have you tried only using the install instruction that applies to the Python version you have installed on your Pi? If you have Python 2.7, only use the Python 2 instruction, and if you have a Python 3 version, only use the Python 3 install instruction. But not both of them. |
@MartyG-RealSense I`ve installed only for python3. pyrealsense2 can not be imported for python2. realsense-viewer though works fine. |
I believe that if you only have Python 3 installed and not Python 2 then you can leave the -DPYTHON_EXECUTABLE command out of the CMake statement. Some users have had failed pyrealsense2 builds when including this command. |
No, I have both python2 and python3 installed by default on my system. |
Okay, so you should include -DPYTHON_EXECUTABLE then, as it tells CMake which Python version to install the bindings in. For some people, using the version of DYPTHON_EXECUTABLE below has worked (i.e three full stops after the equals sign): -DPYTHON_EXECUTABLE=... Again, I very much appreciate your patience during this process. |
@MartyG-RealSense I copied and executed the command including specifying version with that part of command, during installation. |
@MartyG-RealSense Maybe the problem is in SDK version. The version I had working before is 2.35, but now the version installed is 2.36. Can you please give me an advise how can I install 2.35? |
If you are building librealsense from a source code folder as the Pi installation instruction page suggests, you can get the source code folder for any SDK version from the "Assets" list at the bottom of each version's information on the SDK Releases page: 2.35.0 https://github.com/IntelRealSense/librealsense/releases/tag/v2.35.0 2.35.2 https://github.com/IntelRealSense/librealsense/releases/tag/v2.35.2 Download the source code zip file and extract the librealsense folder from it, and then do the usual process of mkdir build and cd build, and using the CMake statement. |
Ok, Thank you for assistance. I`ll try and reply tomorrow. |
Thanks again! |
Hi again @Kosta404 A pyrealsense2 user on the Intel Support version of the RealSense forum who was also using the acrobotic guide had the Module 'pyrealsense2' has no attribute 'pipeline' error too and posted the solution that worked for them. https://support.intelrealsense.com/hc/en-us/community/posts/360048396854/comments/360012486393 |
@MartyG-RealSense Hello! I installed librealsense v2.35.2 and all started working. I guess there is some problem with the latest version of librealsense v2.36.0. Thank you for the provided assistance! |
Thanks very much for letting us know about your success - great to hear! |
Hi @pilipili-vr Installing the pyrealsense2 wrapper on Pi tends to be unpredictably problematic. It either goes fine first time or you encounter problems. It sounds as though you are using the acrobotic guide in the link below. Is that correct,please? https://github.com/acrobotic/Ai_Demos_RPi/wiki/Raspberry-Pi-4-and-Intel-RealSense-D435 My recollection of the module 'pyrealsense2 has no attribute 'pipeline' error is that it is related to script programming rather than an installation error (where you might instead encounter an error such as no module named pyrealsense2). Does that resemble your situation, please - that you only get the error when running a pyrealsense2 script? If so, did you set up the pipeline in your pyrealsense2 script in that way that the example program on the front page of the wrapper documentation suggests: import pyrealsense2: import pyrealsense2 as rs And then define 'pipeline': pipeline = rs.pipeline() Because pipeline is made equal to RS.pipeline, it depends on 'rs' being set up in the first line by '*import pyrealsense2 as rs' |
It works when running in terminal. I was using Thonny and that's where I got the error, but running it in terminal everything seems just fine. That's why I removed my comment, but thanks anyway. I did indeed follow the Acrobotic guide. |
Great news that it is working in the terminal for you - thanks very much for the update! |
Issue Description
I`ve installed pyrealsense through this guide https://github.com/acrobotic/Ai_Demos_RPi/wiki/Raspberry-Pi-4-and-Intel-RealSense-D435. Before reinstalling the system it worked well. Now it says "Attribute error module 'pyrealsense2' has no attribute 'pipeline' "
The text was updated successfully, but these errors were encountered: