RPi.GPIO
A module to control Raspberry Pi GPIO channels
What it is and what it does
RPi.GPIO is a Python module for controlling GPIO pins on Raspberry Pi hardware. It allows you to set pins as inputs or outputs, read digital states, detect rising/falling edges with callbacks, and generate software PWM signals. The module provides both BCM (Broadcom GPIO numbering) and BOARD (physical pin numbering) modes, plus pull-up/pull-down resistor configuration on input pins.
The package is a C extension that accesses GPIO hardware via /dev/gpiomem (or /dev/mem as fallback), avoiding the need for root privileges in most cases. However, the author explicitly warns that it is unsuitable for real-time or timing-critical applications because Python's garbage collection and Linux kernel multitasking introduce unpredictable jitter. The package does not support SPI, I2C, hardware PWM, or serial functionality—only digital I/O and software PWM are available.
Use it for:
- Control LEDs, relays, and other digital outputs on a Raspberry Pi project
- Detect button presses and other digital input events with edge-triggered callbacks
- Generate PWM signals for motor speed control or LED brightness using software PWM
- Implement home automation or IoT projects requiring GPIO-based sensor/actuator control
- Read sensor states and respond to state changes in hobbyist robotics applications
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
RPi.GPIO provides Python control over Raspberry Pi GPIO pins, supporting digital input/output, edge detection, and software PWM on all channels.
No, not for new projects. The package is abandoned (no updates for 1650 days) and explicitly unsuitable for timing-critical work. Install only if you are maintaining legacy code already using RPi.GPIO. For new Raspberry Pi GPIO projects, consider actively maintained alternatives.
Install
rpi-gpio on PyPI
pip
pip install rpi-gpiouv
uv add rpi-gpiopoetry
poetry add rpi-gpioInstalling RPi.GPIO
Before you install
Medium install friction due to platform-specific wheels (linux_armv6l only) and C extension compilation requirements. Package is abandoned as of 1650 days since last release, with no active maintenance or repository updates.
License in practice
MIT license permits commercial and private use with minimal restrictions, requiring only license and copyright notice retention.
Quickstart
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(GPIO.OUT)
GPIO.output(GPIO.HIGH)
GPIO.cleanup()
Requires running on Raspberry Pi hardware with Linux kernel; not suitable for real-time or timing-critical applications due to Python garbage collection and kernel multitasking jitter.
Verify before relying
- Whether the package works reliably on current Raspberry Pi models (last tested with Python 3.10, released 2022-02-06)
- Compatibility with modern Raspberry Pi OS distributions and kernel versions
- Whether SPI, I2C, hardware PWM, serial, or one-wire functionality mentioned as 'planned' was ever implemented
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,650 days since the last release |
| First released | |
| Downloads | 97,601/month — #13,143 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: RPi.GPIO-0.7.1-cp27-cp27mu-linux_armv6l.whl; RPi.GPIO-0.7.1-cp310-cp310-linux_armv6l.whl; RPi.GPIO-0.7.1-cp37-cp37m-linux_armv6l.whl; RPi.GPIO-0.7.1-cp38-cp38-linux_armv6l.whl; RPi.GPIO-0.7.1-cp39-cp39-linux_armv6l.whl
Keywords: Raspberry, Pi, GPIO
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
gpiodPython bindings for libgpiod, the official…
copyleft · top 15,000 on PyPI
gpiozerogpiozero provides a high-level Python interface…
permissive · top 15,000 on PyPI
numato-gpioProvides a Python API to control Numato USB…
permissive · top 15,000 on PyPI
pigpioProvides Python access to the pigpio daemon for…
permissive · top 15,000 on PyPI
pymata-expressAn asyncio-based Python client for controlling…
agpl · top 15,000 on PyPI
Adafruit-BlinkaAdafruit-Blinka emulates CircuitPython APIs on…
permissive · top 15,000 on PyPI
libusbsioProvides a Python wrapper around NXP's…
permissive · top 15,000 on PyPI
zigpy-zigateProvides a Python 3 driver for ZiGate Zigbee…
copyleft · top 15,000 on PyPI
pinsPins publishes and shares Python objects (data,…
permissive · top 15,000 on PyPI
asyncuaasyncua is an asyncio-based OPC UA client and…
copyleft · top 15,000 on PyPI