-
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
ModuleNotFoundError: No module named 'pyrealsense2 by python script in startup (jetson nano) #11387
Comments
Hi @PhenonGH There was a past case at #7861 (comment) that used autostart and they defined their Exec path like this:
Does your error still occur if you change your Exec path from python3 to /usr/bin/python3 The Python 3 path on a particular computer can be found by using the command which python3 |
Thank you for your quick response, unfortunately your solution was not effective and the same error still appears. |
The steps in your build_pyrealsense2_and_SDK.sh build script resemble the list of instructions in the guide at #6964 (comment) for installing librealsense and pyrealsense2 together on Jetson Nano. I cannot see a problem in your script's sequence of commands. The error ModuleNotFoundError: No module named 'pyrealsense2' may occur if the program cannot find the pyrealsense2 files for some reason. A workaround for this is to place two pyrealsense2 .so files in the same folder location as your project script. The two files to place next to your script are librealsense2.so and pyrealsense2.so. When the pyrealsense2 wrapper is built for Python 3, the pyrealsense2.so file will be generated with a complex filename based around your Python 3 version number, such as Aside from #7861 (comment) the pyrealsense2 wrapper has not been reported by RealSense users as being used with autostart, so I would recommend using the wrapper in the conventional way if possible - the 'called normally' approach. |
Ok it works. Workaround: pybackend2.cpython-36m-aarch64-linux-gnu.so.2 from librealsense>build>wrappers>python into my program folder. I don't know if all the files or only some of them are required, I will try it out sometime. Many thanks without your help I probably wouldn't have come up with this solution. The topic can be closed. |
You are very welcome, @PhenonGH - it's excellent news that copying the .so files worked for you. Thanks very much for the update! |
Hi @MartyG-RealSense Brother, I am having the same issue |
Hi @TheMuhammadRafay Which version of the librealsense SDK are you using, please? Support for Python 3.6 was removed from the SDK in version 2.54.1 onwards. |
@MartyG-RealSense I am using the Librealsense SDK 2.55.1 along with the Jetson Nano Jetpack 4.6.5. |
Please try moving the pyrealsense2.cpython-36m-arm-linux-gnueabihf.so file to the same folder that your pyrealsense2 project script is in if you have not done so already, and also move the file librealsense2.so to that folder. If you cannot find both of these .so files then please check for them in the build > wrappers > Python directory of your librealsense2 source code folder. |
ModuleNotFoundError: No module named 'pyrealsense2 by python script in startup (jetson nano)
Hello, I'm having a problem with the pyrealsense2 module. When my Python script is called normally, there are no problems. However, I wanted to build a sort of robot using the Jetson Nano and the camera, so I wanted to put my script into the autostart. Unfortunately, I now always receive the error message: ModuleNotFoundError: No module named 'pyrealsense2'. Additionally, I have discovered that if I run the script with sudo rights, I receive the same error message, but that has never been a real problem for me. I would be very grateful for help, as I am still relatively new to the Linux world.
For the camera installation, I used this: https://github.com/35selim/RealSense-Jetson/blob/main/build_pyrealsense2_and_SDK.sh.
autostart:
[Desktop Entry]
Type=Application
Exec=python3 /home/jetson/My/main.py
Hidden=false
NoDisplay=false
Terminal=true
X-GNOME-Autostart-enabled=true
X-GNOME-Autostart-delay=100
Name[en_US]=v2
Name=v2
Type=Application
Comment[en_US]=
The text was updated successfully, but these errors were encountered: