Run the following command:


sudo apt-get -y install python-rpi.gpio python3-rpi.gpio