Add this line to the top of the * .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.
So you install RPi.GPIO for the correct python version. In this case 3.6.x.
source share