I try to use RPi.GPIO with Python 3.6. I installed RPi.GPIO and it's working with Python 3.4, but not with Python 3.6 I get this Error:
ModuleNotFoundError: No module named 'RPi'
I immport the module in my script like this:
import RPi.GPIO as GPIO
If you code in Python, the RPi. GPIO Python library (included with Raspbian) lets you configure, read, and write to GPIO pins.
GPIO Zero is installed by default in the Raspberry Pi OS desktop image, and the Raspberry Pi Desktop image for PC/Mac, both available from raspberrypi.org.
Add this line to the top of your *.py file:
#!/usr/bin/env python3.6
Run these commands in your shell:
sudo python3.6 -m pip install --upgrade pip setuptools wheel
sudo python3.6 -m pip install RPi.GPIO
This should fix the Problem.
By this you will install RPi.GPIO for the right python version. In this case 3.6.x.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With