Skip to content
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

pyrealsense installs to python2 instead of python3 #11698

Closed
eladpar opened this issue Apr 18, 2023 · 12 comments
Closed

pyrealsense installs to python2 instead of python3 #11698

eladpar opened this issue Apr 18, 2023 · 12 comments

Comments

@eladpar
Copy link

eladpar commented Apr 18, 2023


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
#6964 (comment)
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
Copy link
Collaborator

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

@eladpar
Copy link
Author

eladpar commented Apr 18, 2023

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
Copy link
Collaborator

/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
Copy link
Author

eladpar commented Apr 18, 2023

/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
Copy link
Collaborator

MartyG-RealSense commented Apr 18, 2023

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
Copy link
Author

eladpar commented Apr 18, 2023

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
Copy link
Collaborator

MartyG-RealSense commented Apr 18, 2023

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
Copy link
Collaborator

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

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

@IricEmage
Copy link

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

@MartyG-RealSense
Copy link
Collaborator

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
Copy link

I got it. Thanks you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants