-
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' #7540
Comments
Here some more information: My OS is MacOS Catalina 10.15.7. With 2.36.0 I get this:
With 2.39.0 this:
Make procedure is:
|
Does also not work with 2.38. Has maybe to do with a changed install directory for the libs... 2.38/39 is installing to /usr/local/lib/python3.8/site-packages/pyrealsense2/ |
The change happened between 2.36.0 and 2.37.0 |
Looks like #6820 |
... and definitely the "fix" proposed in #6820 does it:
I don't have a good feeling with this fix, because there are a couple of changes between these two files, not just one line... Anyway, after reverting the CMakeList.txt to the 2.34.0 version everything is fine again... The question now is: How can such a problem be unknown since month? In fact since 2.36.0 Python is dysfunctional... |
Alternative approach: Use the right CMakeList.txt and change the PYTHONPATH. For instance: Path in older versions:
Path from 2.37.0 on (for instance):
|
Hey nei, I have came across an issue exactly as you did, under SDK2.38,python_version=3.8, but camera works from the source code. Besides that, I use conda to create an env,python==3.6(it only support 3.5-3.7), install it from PYPI, it can also work, see if you would have a try. |
@lancetee In the end it was just a changed install directory for the libs. I reported a solution here #7540 (comment). For me that works. The PYPI is not a solution for me, because there is no package for macOS. |
For me, I hade to do
|
sudo make install have a wrong place for libs. Current it in dist-packages/pyrealsense2 folder, but python search in dist-packages. For developers - I stronlgy ask to fix this. |
I have build pyrealsense version 2.40 with Python 3.8 on a Jetson Xavier AGX and also ran into the The following shows where everything was installed. Since I created a virtual environment it is also copying the files to the respective directory. Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/librealsense2.so.2.40.0
-- Installing: /usr/local/lib/librealsense2.so.2.40
-- Installing: /usr/local/lib/librealsense2.so
-- Up-to-date: /usr/local/include/librealsense2
-- Up-to-date: /usr/local/include/librealsense2/hpp
-- Up-to-date: /usr/local/include/librealsense2/hpp/rs_options.hpp
-- Up-to-date: /usr/local/include/librealsense2/hpp/rs_context.hpp
-- Up-to-date: /usr/local/include/librealsense2/hpp/rs_serializable_device.hpp
-- Up-to-date: /usr/local/include/librealsense2/hpp/rs_pipeline.hpp
-- Up-to-date: /usr/local/include/librealsense2/hpp/rs_internal.hpp
-- Up-to-date: /usr/local/include/librealsense2/hpp/rs_types.hpp
-- Up-to-date: /usr/local/include/librealsense2/hpp/rs_sensor.hpp
-- Up-to-date: /usr/local/include/librealsense2/hpp/rs_record_playback.hpp
-- Up-to-date: /usr/local/include/librealsense2/hpp/rs_device.hpp
-- Up-to-date: /usr/local/include/librealsense2/hpp/rs_frame.hpp
-- Up-to-date: /usr/local/include/librealsense2/hpp/rs_processing.hpp
-- Up-to-date: /usr/local/include/librealsense2/hpp/rs_export.hpp
-- Up-to-date: /usr/local/include/librealsense2/rs_advanced_mode.hpp
-- Up-to-date: /usr/local/include/librealsense2/rs.hpp
-- Up-to-date: /usr/local/include/librealsense2/rsutil.h
-- Up-to-date: /usr/local/include/librealsense2/h
-- Up-to-date: /usr/local/include/librealsense2/h/rs_record_playback.h
-- Up-to-date: /usr/local/include/librealsense2/h/rs_types.h
-- Up-to-date: /usr/local/include/librealsense2/h/rs_processing.h
-- Up-to-date: /usr/local/include/librealsense2/h/rs_config.h
-- Up-to-date: /usr/local/include/librealsense2/h/rs_sensor.h
-- Up-to-date: /usr/local/include/librealsense2/h/rs_advanced_mode_command.h
-- Up-to-date: /usr/local/include/librealsense2/h/rs_internal.h
-- Up-to-date: /usr/local/include/librealsense2/h/rs_device.h
-- Up-to-date: /usr/local/include/librealsense2/h/rs_option.h
-- Up-to-date: /usr/local/include/librealsense2/h/rs_frame.h
-- Up-to-date: /usr/local/include/librealsense2/h/rs_context.h
-- Up-to-date: /usr/local/include/librealsense2/h/rs_pipeline.h
-- Up-to-date: /usr/local/include/librealsense2/rs.h
-- Up-to-date: /usr/local/include/librealsense2/rs_advanced_mode.h
-- Installing: /usr/local/lib/cmake/realsense2/realsense2Targets.cmake
-- Installing: /usr/local/lib/cmake/realsense2/realsense2Targets-noconfig.cmake
-- Installing: /usr/local/lib/cmake/realsense2/realsense2Config.cmake
-- Installing: /usr/local/lib/cmake/realsense2/realsense2ConfigVersion.cmake
-- Installing: /usr/local/lib/pkgconfig/realsense2.pc
-- Installing: /usr/local/lib/librealsense-file.a
-- Installing: /home/xavier/venv-python38/road-detection/lib/python3.8/site-packages/pyrealsense2/pybackend2.cpython-38-aarch64-linux-gnu.so.2.40.0
-- Installing: /home/xavier/venv-python38/road-detection/lib/python3.8/site-packages/pyrealsense2/pybackend2.cpython-38-aarch64-linux-gnu.so.2
-- Installing: /home/xavier/venv-python38/road-detection/lib/python3.8/site-packages/pyrealsense2/pybackend2.cpython-38-aarch64-linux-gnu.so
-- Installing: /home/xavier/venv-python38/road-detection/lib/python3.8/site-packages/pyrealsense2/pyrealsense2.cpython-38-aarch64-linux-gnu.so.2.40.0
-- Installing: /home/xavier/venv-python38/road-detection/lib/python3.8/site-packages/pyrealsense2/pyrealsense2.cpython-38-aarch64-linux-gnu.so.2.40
-- Set runtime path of "/home/xavier/venv-python38/road-detection/lib/python3.8/site-packages/pyrealsense2/pyrealsense2.cpython-38-aarch64-linux-gnu.so.2.40.0" to ""
-- Installing: /home/xavier/venv-python38/road-detection/lib/python3.8/site-packages/pyrealsense2/pyrealsense2.cpython-38-aarch64-linux-gnu.so
-- Installing: /usr/local/lib/cmake/pyrealsense2/pyrealsense2Targets.cmake
-- Installing: /usr/local/lib/cmake/pyrealsense2/pyrealsense2Targets-noconfig.cmake
-- Installing: /usr/local/lib/cmake/pyrealsense2/pyrealsense2Config.cmake
-- Installing: /usr/local/lib/cmake/pyrealsense2/pyrealsense2ConfigVersion.cmake
-- Installing: /usr/local/lib/librealsense2-gl.so.2.40.0
-- Installing: /usr/local/lib/librealsense2-gl.so.2.40
-- Set runtime path of "/usr/local/lib/librealsense2-gl.so.2.40.0" to ""
-- Installing: /usr/local/lib/librealsense2-gl.so
-- Up-to-date: /usr/local/include/librealsense2-gl/rs_processing_gl.h
-- Up-to-date: /usr/local/include/librealsense2-gl/rs_processing_gl.hpp
-- Installing: /usr/local/lib/cmake/realsense2-gl/realsense2-glTargets.cmake
-- Installing: /usr/local/lib/cmake/realsense2-gl/realsense2-glTargets-noconfig.cmake
-- Installing: /usr/local/lib/cmake/realsense2-gl/realsense2-glConfig.cmake
-- Installing: /usr/local/lib/cmake/realsense2-gl/realsense2-glConfigVersion.cmake
-- Installing: /usr/local/lib/pkgconfig/realsense2-gl.pc
-- Installing: /usr/local/bin/rs-hello-realsense
-- Set runtime path of "/usr/local/bin/rs-hello-realsense" to ""
-- Installing: /usr/local/bin/rs-software-device
-- Set runtime path of "/usr/local/bin/rs-software-device" to ""
-- Installing: /usr/local/bin/rs-capture
-- Set runtime path of "/usr/local/bin/rs-capture" to ""
-- Installing: /usr/local/bin/rs-callback
-- Set runtime path of "/usr/local/bin/rs-callback" to ""
-- Installing: /usr/local/bin/rs-save-to-disk
-- Set runtime path of "/usr/local/bin/rs-save-to-disk" to ""
-- Installing: /usr/local/bin/rs-multicam
-- Set runtime path of "/usr/local/bin/rs-multicam" to ""
-- Installing: /usr/local/bin/rs-pointcloud
-- Set runtime path of "/usr/local/bin/rs-pointcloud" to ""
-- Installing: /usr/local/bin/rs-align
-- Set runtime path of "/usr/local/bin/rs-align" to ""
-- Installing: /usr/local/bin/rs-align-advanced
-- Set runtime path of "/usr/local/bin/rs-align-advanced" to ""
-- Installing: /usr/local/bin/rs-sensor-control
-- Set runtime path of "/usr/local/bin/rs-sensor-control" to ""
-- Installing: /usr/local/bin/rs-measure
-- Set runtime path of "/usr/local/bin/rs-measure" to ""
-- Installing: /usr/local/bin/rs-depth
-- Set runtime path of "/usr/local/bin/rs-depth" to ""
-- Installing: /usr/local/bin/rs-color
-- Set runtime path of "/usr/local/bin/rs-color" to ""
-- Installing: /usr/local/bin/rs-distance
-- Set runtime path of "/usr/local/bin/rs-distance" to ""
-- Installing: /usr/local/bin/rs-post-processing
-- Set runtime path of "/usr/local/bin/rs-post-processing" to ""
-- Installing: /usr/local/bin/rs-record-playback
-- Set runtime path of "/usr/local/bin/rs-record-playback" to ""
-- Installing: /usr/local/bin/rs-motion
-- Set runtime path of "/usr/local/bin/rs-motion" to ""
-- Installing: /usr/local/bin/rs-gl
-- Set runtime path of "/usr/local/bin/rs-gl" to ""
-- Installing: /usr/local/bin/rs-pose
-- Set runtime path of "/usr/local/bin/rs-pose" to ""
-- Installing: /usr/local/bin/rs-pose-predict
-- Set runtime path of "/usr/local/bin/rs-pose-predict" to ""
-- Installing: /usr/local/bin/rs-pose-and-image
-- Set runtime path of "/usr/local/bin/rs-pose-and-image" to ""
-- Installing: /usr/local/bin/rs-trajectory
-- Set runtime path of "/usr/local/bin/rs-trajectory" to ""
-- Installing: /usr/local/bin/rs-ar-basic
-- Set runtime path of "/usr/local/bin/rs-ar-basic" to ""
-- Installing: /usr/local/bin/rs-ar-advanced
-- Set runtime path of "/usr/local/bin/rs-ar-advanced" to ""
-- Installing: /usr/local/bin/rs-tracking-and-depth
-- Set runtime path of "/usr/local/bin/rs-tracking-and-depth" to ""
-- Installing: /usr/local/bin/rs-hdr
-- Set runtime path of "/usr/local/bin/rs-hdr" to ""
-- Installing: /usr/local/bin/rs-convert
-- Set runtime path of "/usr/local/bin/rs-convert" to ""
-- Installing: /usr/local/bin/rs-enumerate-devices
-- Set runtime path of "/usr/local/bin/rs-enumerate-devices" to ""
-- Installing: /usr/local/bin/rs-fw-logger
-- Set runtime path of "/usr/local/bin/rs-fw-logger" to ""
-- Installing: /usr/local/bin/rs-terminal
-- Set runtime path of "/usr/local/bin/rs-terminal" to ""
-- Installing: /usr/local/bin/rs-record
-- Set runtime path of "/usr/local/bin/rs-record" to ""
-- Installing: /usr/local/bin/rs-fw-update
-- Set runtime path of "/usr/local/bin/rs-fw-update" to ""
-- Installing: /usr/local/bin/rs-data-collect
-- Set runtime path of "/usr/local/bin/rs-data-collect" to ""
-- Installing: /usr/local/bin/realsense-viewer
-- Set runtime path of "/usr/local/bin/realsense-viewer" to ""
-- Installing: /usr/local/bin/rs-depth-quality
-- Set runtime path of "/usr/local/bin/rs-depth-quality" to ""
-- Installing: /usr/local/bin/rs-rosbag-inspector
-- Set runtime path of "/usr/local/bin/rs-rosbag-inspector" to ""
-- Installing: /usr/local/bin/rs-benchmark
-- Set runtime path of "/usr/local/bin/rs-benchmark" to ""
-- Installing: /usr/local/lib/libfw.a @neilyoung where would you point the export to? |
In my case also the following is an option: export PYTHONPATH=$PYTHONPATH:/home/xavier/venv-python38/road-detection/lib/python3.8/site-packages/pyrealsense2/ Please note that I have installed it within a virtual environment. |
Same problem here. |
This worked for me. I am using RPi3+ with Realsense d435i. Thanks. |
This worked for me . But i worked on it a bit on why we had to do this. Like @TDHster mentioned, python looks in dist-packages/pyrealsense2. this pyrealsense2 folder has the .so objects. But to be able to treat this as a library package, copy the init.py file from librealsense wrapper.
Note: I had pyrealsense2 folder present at |
@07hokage 's solution worked for me. |
Worked for me too, as of this date. Same issue with the dist-packages/pyrealsense2/*.so For those who are having difficulty in finding the location of their pyrealsense2*.so, here's a simple shell one-liner |
I apologize, I wasn't active here for a long time. I tested my code (Python, https://github.com/neilyoung/t265-realsense-poc-application) against the latest 2.39.0. I found some issues, for instance "context" and "pipeline" seem to be no longer attributes of pyrealsense2.
I stepped back to 2.36.0 and found everything OK as with the version 2.34.0, I tested with.
Would you mind to point me to the change here? When did it happen? How to deal with it?
The text was updated successfully, but these errors were encountered: