Hello there,
I am trying to use the RPi.GPIO to enable a LED on my board. I have added the RUN pip install smbus2 paho-mqtt requests RPi.GPIO
But when I add in my code import RPi.GPIO as GPIO it returns
sensor File "/usr/lib/python3/dist-packages/RPi/GPIO/__init__.py", line 23, in <module>
sensor from RPi._GPIO import *
sensor ModuleNotFoundError: No module named 'RPi._GPIO'
I’ve tried to make it work from a simple python script:
Hi there, can you share which base image you were using and for which device type so we can try to reproduce? I would try using pip3 instead of pip but depending on your base image they may be the same.
In the case of the sensors block, can you describe the exact changes you made to the Dockerfile and python script when it failed?
Hello @pipex,
I did resolve this from led-alerter-code-fails-to-push-to-app. It was that for some reason it does not work if you include in the install_packages the rpio.gpio. I removed it from the Dockerfile.template and it worked as it was supposed to.