The Raspberry Pi GPIO(General Purpose Input Output) module is already installed by default in Raspbian Operating System. Just to make it sure that it is at the latest version. just follow the instructions below.
1 2 |
$ sudo apt-get update $ sudo apt-get install python-rpi.gpio python3-rpi.gpio |
Installing the later development version from the project source code library below are the steps to install.
1 2 3 4 5 6 |
$ sudo apt-get install python-dev python3-dev $ sudo apt-get install mercurial $ sudo apt-get install python-pip python3-pip $ sudo apt-get remove python-rpi.gpio python3-rpi.gpio $ sudo pip install hg+http://hg.code.sf.net/p/raspberry-gpio-python/code#egg=RPi.GPIO $ sudo pip-3.2 install hg+http://hg.code.sf.net/p/raspberry-gpio-python/code#egg=RPi.GPIO |
To revert back the installation to default version on Rasbin
1 2 3 |
$ sudo pip uninstall RPi.GPIO $ sudo pip-3.2 uninstall RPi.GPIO $ sudo apt-get install python-rpi.gpio python3-rpi.gpio |
On other Linux distributions installation you need to install Raspberry Pi GPIO using PIP UTILITY as superuser or root system privilege.
1 |
#pip install RPi.GPIO |
Setup and Installation of Raspberry Pi GPIO on Raspbian