no0by5
no0by5

Reputation: 632

Use RPi.GPIO with Python 3.6

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

Upvotes: 8

Views: 2184

Answers (1)

Rulle
Rulle

Reputation: 61

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.

Upvotes: 6

Related Questions