IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.58k stars 4.82k forks source link

pyrealsense installs to python2 instead of python3 #11698

Closed eladpar closed 1 year ago

eladpar commented 1 year ago

Required Info
Camera Model { D400 }
Firmware Version 2.50.0
Operating System & Version Ubuntu 20
Kernel Version (Linux Only) 5.10.104-tegra
Platform NVIDIA jetson xavier NX
SDK Version { legacy / 2.<?>.<?> }
Language {C/C#/labview/nodejs/opencv/pcl/python/unity }
Segment {Robot/Smartphone/VR/AR/others }

I want my pyrealsense2 to be installed in python3 iv'e been using this instruction by @MartyG-RealSense https://github.com/IntelRealSense/librealsense/issues/6964#issuecomment-665650908 I run the command: cmake ../ -DFORCE_RSUSB_BACKEND=ON -DBUILD_PYTHON_BINDINGS:bool=true -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true -DBUILD_WITH_CUDA:bool=true But still when I run sudo make install I get: -- Up-to-date: /usr/lib/python2.7/dist-packages/pyrealsense2/pybackend2.cpython-38-aarch64-linux-gnu.so.2.50.0 Why is not installing in python3 dist-packages?

MartyG-RealSense commented 1 year ago

Hi @eladpar I recommend using the Jetson installation guide at https://github.com/IntelRealSense/librealsense/issues/6964#issuecomment-707501049 which is further down the page that you linked to.

eladpar commented 1 year ago

Hi @eladpar I recommend using the Jetson installation guide at #6964 (comment) which is further down the page that you linked to.

Sorry my link was wrong I did use the one you sent

MartyG-RealSense commented 1 year ago

/pybackend2.cpython-38-aarch64-linux-gnu.so is a filename that would be created when building the pyrealsense2 wrapper if Python 3.8 is installed on your computer.

Have you performed steps 7 and 8 - setting the PYTHONPATH and sourcing the bashrc file?

eladpar commented 1 year ago

/pybackend2.cpython-38-aarch64-linux-gnu.so is a filename that would be created when building the pyrealsense2 wrapper if Python 3.8 is installed on your computer.

Have you performed steps 7 and 8 - setting the PYTHONPATH and sourcing the bashrc file?

But i'm in step 6 ... your'e saying it did detect im using python3.8 but still put the artifacts in the wrong folder

steps 7 and 8 are not relevant because the folder is not located in /usr/local/lib/python3.8

MartyG-RealSense commented 1 year ago

In the guide there is a typing mistake where there should not be a space between '-' and 'DPYTHON' in:

- DPYTHON_EXECUTABLE=/usr/bin/python3.6

Did you close up the space between - and DPYTHON when using the CMake build instruction? And did you modify the instruction to say python3.8 instead of python3.6 if 3.8 is the Python version that is installed on your computer?

You can confirm which Python 3 version you have with the command which python3

eladpar commented 1 year ago

In the guide there is a typing mistake where there should not be a space between '-' and 'DPYTHON' in:

- DPYTHON_EXECUTABLE=/usr/bin/python3.6

Did you close up the space between - and DPYTHON when using the CMake build instruction? And did you modify the instruction to say python3.8 instead of python3.6 if 3.8 is the Python version that is installed on your computer?

You can confirm which Python 3 version you have with the command which python3

I changed it to be '-DPYTHON_EXECUTABLE=/usr/bin/python3' and I checked that my python3 executable is '/usr/bin/python3'

MartyG-RealSense commented 1 year ago

It may be worth starting the installation process again and when you get to step 6, use the CMake command below instead whilst in the 'build' folder to uninstall the currently installed SDK and then begin a new installation of the SDK and pyrealsense2 wrapper.

sudo make uninstall && make clean && make -j4 && sudo make install

If you are not certain which Python 3 version number you have got installed on your computer then use:

-DPYTHON_EXECUTABLE=/usr/bin/python3

MartyG-RealSense commented 1 year ago

Hi @eladpar Do you require further assistance with this case, please? Thanks!

MartyG-RealSense commented 1 year ago

Case closed due to no further comments received.

IricEmage commented 1 year ago

I have the same issue, it install into python2.7 instead of python3, I follow the link you send

MartyG-RealSense commented 1 year ago

Hi @IricEmage Please create a new issue for your problem by visiting the front page of this support forum at the link below and clicking the green New Issue button. Thanks!

https://github.com/IntelRealSense/librealsense/issues/

IricEmage commented 1 year ago

I got it. Thanks you