-
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
How can I use pyrealsense2 with python 3.12? #13039
Comments
Hi @mrortach At the time of writing this the pip install pyrealsense2 method does not yet support Python 3.12 (though the support is planned to be implemented), so the pyrealsense2 wrapper must be compiled from source code instead. This can be done with CMake at the same time as building librealsense, or after librealsense has been installed. If you need pyrealsense2 as a pip package installation for Python 3.12 then a method of creating a custom pip package yourself is suggested at #12601 (comment) |
I still don't know enough to do this. |
If you are not experienced with building with CMake then the simplest approach available may be to use an edited version of the libuvc backend build script. The installation instructions for the libuvc backend procedure can be found here: https://github.com/IntelRealSense/librealsense/blob/master/doc/libuvc_installation.md The procedure builds librealsense using a pre-made script called libuvc_installation.sh. To build librealsense and the pyrealsense2 wrapper, you could make an edit to the CMake build instruction on line 46 of the script. https://github.com/IntelRealSense/librealsense/blob/master/scripts/libuvc_installation.sh#L46 Change line 46 from this:
To this:
|
Only I use windows. Actually, I learned a lot while compiling it, but I couldn't finish it. |
You could build the librealsense SDK and pyrealsense2 wrapper together from source code with CMake instead of using the Intel.RealSense.SDK-WIN10 installer file by following the instructions at the link below. That would enable you to include the flags BUILD_PYTHON_BINDINGS:bool=true and PYTHON_EXECUTABLE=/usr/bin/python3.12 https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_windows.md Alternatively, you can build the pyrealsense2 wrapper from source code separately after librealsense has been installed by the installer file. https://github.com/IntelRealSense/librealsense/tree/master/wrappers/python#windows |
I am not familiar with the LNK4098 error, though a RealSense user at the link below who also experienced it was offered advice about resolving it. |
Hi @mrortach Do you require further assistance with this case, please? Thanks! |
#13040 Actually, the problem was partially solved, but I still had a problem because pyrealsense2 could not be installed according to version 2.54.2.5684. While trying to solve it, more problems arose. |
Case closed due to no further comments received. |
How can I use pyrealsense2 with python 3.12?
The text was updated successfully, but these errors were encountered: