-
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
no attribute 'pipeline" #13706
Comments
Hi @Oscar33391 Does it make a difference if you change import pyrealsense2 as rs to the line below, please?
|
hi @MartyG-RealSense , When i import pyrealsense2.pyrealsense2, it output ModuleNotFoundError: No module named 'pyrealsense2.pyrealsense2' |
Thanks very much for the information. Please assist me with the questions below.
|
1, my camera is D435i
source ~/.bashrc
|
The Python version referenced in the DBUILD_PYTHON_BINDINGS and PYTHONPATH lines has to match the Python 3 version that is actually installed on your computer or pyrealsense2 will not be able to locate Python. So it would not work, for example, if you were setting the Python version as python3.6 but actually had Python 3.9 installed on your computer. You can find the correct PYTHONPATH to use with the command You should not need to use the DPYTHON_EXECUTABLE parameter though unless you have multiple Python versions installed on the same computer. If you do have Python 3.6 installed on your computer then it will not work with librealsense version 2.54.1 and newer as Python 3.6 support was removed in 2.54.1. |
i changed my python version to python3.8 and when i run pipeline = rs.pipeline(), i still got the same error |
When the pyrealsense2 wrapper has been built from source code like you did, the important location to look in for wrapper files is the librealsense source code folder.
What files do you have in the 'python' folder at this location, please? |
hi @MartyG-RealSense it have 5 file in this folder CMakeFiles cmake_install.cmake Makefile pyrealsense2Config.cmake pyrealsense2ConfigVersion.cmake |
When pyrealsense2 is successfully built from source code, it should generate '.so' files, librealsense2.so and pyrealsense2.so. When building the wrapper for Python 3, pyrealsense2.so will have an auto-generated complex filename with a number in it that depends on the Python 3 version being used., For example, using Python 9 may result in a filename such as The pyrealsense2.so file will typically be placed by the installation in the Do you still get the pipeline attribute error if you input the line below into your terminal before you launch your Python script?
|
hi @MartyG-RealSense Also i tired to run |
update i fixed everything by following the instructions on #11506 (comment) |
IT's great to hear that you achieved a solution, @Oscar33391 - thanks very much for the update! |
when i am working with jetson nano, i using the pyrealsense2 with Intel D4350i , and facing this error
Initialization error: module 'pyrealsense2' has no attribute 'pipeline'
Traceback (most recent call last):
File "/home/jetson/jetracer/notebooks/test123.py", line 6, in
dc = DepthCamera()
File "/home/jetson/jetracer/notebooks/realsense_depth.py", line 11, in init
self.pipeline = rs.pipeline()
AttributeError: module 'pyrealsense2' has no attribute 'pipeline'
The text was updated successfully, but these errors were encountered: