Note
The library has been tested against Python 2.7 and 3.4+.
For Python3 installation, substitute pip3 for pip in the instructions below.
pip3
pip
Install the latest version of the library directly from PyPI:
$ sudo pip install --upgrade OPi.GPIO