error "import RPi.GPIO" with image ROS from Ubiquity Robotics

asked 2021-07-17 14:38:48 -0500

mateusguilherme gravatar image

Hi I downloaded the image (2020-11-07) with ROS for raspberry pi 4 from the website: https://downloads.ubiquityrobotics.co.... When I ran a python script I got the following message:

Traceback (most recent call last):
   File "/home/ubuntu/catkin_ws/src/auto_docking/scripts/autoDocking.py", line 14, in <module>
     import RPi.GPIO as GPIO
   File "/usr/lib/python2.7/dist-packages/RPi/GPIO/__init__.py", line 23, in <module>
     from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

Does anyone have any suggestions?

edit retag flag offensive close merge delete

Comments

do you have the libary installed on your pi install with pip install RPi.GPIO

bribri123 gravatar image bribri123  ( 2021-07-17 21:21:14 -0500 )edit