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

ModuleNotFoundError: No module named 'pyrealsense2' [Jetson Nano; Intel D435; Python3.6] #8324

Closed
josh-github1 opened this issue Feb 7, 2021 · 6 comments

Comments

@josh-github1
Copy link

@MartyG-RealSense That did the trick.

For future reference, here is a complete list of steps I took to get the IntelRealsense Camara D455 to work with python3 on the Jetson Nano.

  1. Update CMake using this method
    (You need to have curl installed for this to work. )

  2. Download the zip file from https://github.com/IntelRealSense/librealsense/releases/. I am using version 2.38.1

  3. Extract the file, cd into the extracted file .

  4. Create a dir called build and cd into it.

  5. Run the CMake command to test to see if the build will work.
    cmake ../ -DFORCE_RSUSB_BACKEND=ON -DBUILD_PYTHON_BINDINGS:bool=true - DPYTHON_EXECUTABLE=/usr/bin/python3.6 -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true -DBUILD_WITH_CUDA:bool=true

If you have issues with the above step, check out this, this and this

  1. Still in the build dir. Run make -j4 and then sudo make install.

  2. Add these to the end of your .bashrc file

export PATH=$PATH:~/.local/bin
export PYTHONPATH=$PYTHONPATH:/usr/local/lib
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.6/pyrealsense2
  1. source your .bashrc file

  2. Deal with package restructuring between python2 and python3 using this method

You should now be able to import pyrealsense2 using python3

@MartyG-RealSense thank you once again for your help 💯

Update: I can confirm that this works for the Jetson Xavier NX as well.

Originally posted by @Drkstr in #6964 (comment)

@josh-github1
Copy link
Author

josh-github1 commented Feb 7, 2021

I've followed all these steps and it still isn't recognizing pyrealsense2 in the python import. I got up to number 8.

In /usr/lib/python3.6/site-packages there is no pyrealsense2 folder.

I'll try doing the cmake and make commands and seeing how it goes but wanted to post this here in case someone is running into the same issue. This experiment is being done on the original jetson nano running on the latest jetpack and ubuntu 20. I have python3.8 also installed and sure that might be an issue but idk its late.

EDIT
I'm actually on ubuntu 18.04.4; cmake version 3.13.0; and jetpack 4.4

@MartyG-RealSense
Copy link
Collaborator

Hi @josh-github1 May I begin by asking whether librealsense and the RealSense Viewer program are working correctly after installation has completed?

Also, is the information in the link below by another Nano user of this installation guide helpful to your problem?

#7775 (comment)

@josh-github1 josh-github1 changed the title @MartyG-RealSense That did the trick. ModuleNotFoundError: No module named 'pyrealsense2' [Jetson Nano and D435] Feb 7, 2021
@josh-github1 josh-github1 changed the title ModuleNotFoundError: No module named 'pyrealsense2' [Jetson Nano and D435] ModuleNotFoundError: No module named 'pyrealsense2' [Jetson Nano; Intel D435; Python3.6] Feb 7, 2021
@josh-github1
Copy link
Author

josh-github1 commented Feb 7, 2021

There was a Jetson case involving AttributeError: module 'pyrealsense2' has no attribute 'pipeline' where the solution in that particular case was found to be to copy .so files to the same directory that the user's project script was in.

#7078 (comment)

This same approach of copying the .so files into the same directory as the user's project script also worked in another case:

https://support.intelrealsense.com/hc/en-us/community/posts/360048396854/comments/360012486393

There was a Jetson case involving AttributeError: module 'pyrealsense2' has no attribute 'pipeline' where the solution in that particular case was found to be to copy .so files to the same directory that the user's project script was in.

#7078 (comment)

This same approach of copying the .so files into the same directory as the user's project script also worked in another case:

https://support.intelrealsense.com/hc/en-us/community/posts/360048396854/comments/360012486393

THIS WORKED

@MartyG-RealSense
Copy link
Collaborator

Excellent news that you found a method that worked for you. Thanks for the update!

@MartyG-RealSense
Copy link
Collaborator

Hi @josh-github1 Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

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

2 participants