Not sure if this is helpful, but under the latest copy of Raspbian I was able to install RPi.GPIO directly from the main repositories using apt-get as follows:

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

If you're running Python 3 (idle3 on the command line) instead of Python 2 (python on the command line) you need to install the RPi.GPIO library with this command instead:

sudo apt-get -y install python3-rpi.gpio
Answer from PiBorg on Stack Exchange
🌐
PyPI
pypi.org › project › RPi.GPIO
RPi.GPIO · PyPI
This package provides a Python module to control the GPIO on a Raspberry Pi.
      » pip install RPi.GPIO
    
Published   Feb 06, 2022
Version   0.7.1
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
What is the official Raspberry Pi library for accessing GPIO ports ? - Raspberry Pi Forums
September 14, 2024 - I can't belive that is so complicated to use some damn ports on a Raspberry Pi, which is supposed to be fun and joy... rpi-lgpio is a compatibility shim that uses lgpio to provide a RPi.GPIO interface that allows older programs written for that library to migrate to lgpio.
🌐
SparkFun Learn
learn.sparkfun.com › tutorials › raspberry-gpio › python-rpigpio-example
Python (RPi.GPIO) Example - Raspberry gPIo - SparkFun Learn
language:Python # External module imports import RPi.GPIO as GPIO import time # Pin Definitons: pwmPin = 18 # Broadcom pin 18 (P1 pin 12) ledPin = 23 # Broadcom pin 23 (P1 pin 16) butPin = 17 # Broadcom pin 17 (P1 pin 11) dc = 95 # duty cycle (0-100) for PWM pin # Pin Setup: GPIO.setmode(GPIO.BCM) # Broadcom pin-numbering scheme GPIO.setup(ledPin, GPIO.OUT) # LED pin set as output GPIO.setup(pwmPin, GPIO.OUT) # PWM pin set as output pwm = GPIO.PWM(pwmPin, 50) # Initialize PWM on pwmPin 100Hz frequency GPIO.setup(butPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) # Button pin set as input w/ pull-up # Initial state for LEDs: GPIO.output(ledPin, GPIO.LOW) pwm.start(dc) print("Here we go!
🌐
SourceForge
sourceforge.net › home › browse › raspberry-gpio-python › wiki
raspberry-gpio-python / Wiki / Home
You will get a list of functions : ['BCM', 'BOARD', 'BOTH', 'FALLING', 'HARD_PWM', 'HIGH', 'I2C', 'IN', 'LOW', 'OUT', 'PUD_DOWN', 'PUD_OFF', 'PUD_UP', 'PWM', 'RISING', 'RPI_INFO', 'RPI_REVISION', 'SERIAL', 'SPI', 'UNKNOWN', 'VERSION', 'builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'path', 'spec', 'add_event_callback', 'add_event_detect', 'cleanup', 'event_detected', 'getmode', 'gpio_function', 'input', 'output', 'remove_event_detect', 'setmode', 'setup', 'setwarnings', 'wait_for_edge'] you can test the capital ones like this : python -c 'import RPi.GPIO as GPIO; print(GPIO.VERSION)'
🌐
GitHub
github.com › alanbarr › RaspberryPi-GPIO-Python
GitHub - alanbarr/RaspberryPi-GPIO-Python: Python Wrapper for Raspberry Pi GPIO control. · GitHub
#################### Building #################### You will need the Python development package to build this module: sudo apt-get install python3-dev Once you clone this repository, you first need to obtain the submodule: Enter the RaspberryPi-GPIO-Python directory and issue: git submodule update --init Once that has downloaded, change directory to src: cd src Issue the following command to install (this may have to be done as root): python3 setup.py install #################### Using #################### To use this library you will need to run your python script as root: sudo python3 You can then import the module with: import gpyo Some python documentation is availble with: help("gpyo")
Author   alanbarr
🌐
Medium
medium.com › writearobot › basic-setup-and-working-with-raspberry-pis-rpi-gpio-module-of-python-d6bb3ea0d9ea
Basic setup and working with raspberry pi’s RPI GPIO Module of python | by Surya Teja | writearobot | Medium
April 17, 2018 - # Import modules import RPi.GPIO as GPIO import time Import atexit#PIN setup GPIO.setmode(GPIO.BCM) GPIO.setup(4, GPIO.OUTPUT)# Loop to send HIGH and LOW to the mentioned pin While True: GPIO.output(4,GPIO.HIGH) time.sleep(1) GPIO.output(4,GPIO.LOW) time.sleep(1)#Garabage Cleaner def clean_up(): GPIO.cleanup()atexit.register(clean_up)
Find elsewhere
🌐
DEV Community
dev.to › suryasr007 › raspberry-pi-s-rpi-gpio-module-of-python-51j6
Raspberry pi’s RPI GPIO Module of python - DEV Community
July 7, 2019 - Make sure that python>2.7 is installed in the raspberry Pi. ... The option specifies that you are referring to the pins by the number of the pin the plug i.e the numbers printed on the board. GPIO.BCM: Broadcom chip-specific pin numbers. The option means that you are referring to the pins by the “Broadcom SOC channel” number. Once the basic setup is completed, Based on the requirement we set the pins to high or low · # Import modules import RPi.GPIO as GPIO import time Import atexit #PIN setup GPIO.setmode(GPIO.BCM) GPIO.setup(4, GPIO.OUTPUT) # Loop to send HIGH and LOW to the mentioned pin While True: GPIO.output(4,GPIO.HIGH) time.sleep(1) GPIO.output(4,GPIO.LOW) time.sleep(1) #Garabage Cleaner def clean_up(): GPIO.cleanup() atexit.register(clean_up)
🌐
Random Nerd Tutorials
randomnerdtutorials.com › home › project › raspberry pi › raspberry pi: read digital inputs with python (buttons and other peripherals)
Raspberry Pi: Read Digital Inputs with Python (Buttons and Other Peripherals) | Random Nerd Tutorials
July 19, 2023 - In this guide, you'll learn how to set the Raspberry Pi GPIOs as digital inputs and how to read their state using a Python program. As an example, we'll read the state of a pushbutton (pressed or not pressed), but the example can be applied to any other peripherals that output digital signals.
🌐
Stack Overflow
stackoverflow.com › questions › 59167687 › controlling-gpio-in-rpi-via-python-2-input
Controlling GPIO in RPI via python 2 input - Stack Overflow
import RPi.GPIO as GPIO import time # Pin constants PIN_GREEN = 17 PIN_OTHER1 = 21 PIN_OTHER2 = 26 def setupGPIO(): # Configure GPIO PINs GPIO.setwarnings( False ) GPIO.setmode( GPIO.BCM ) GPIO.setup( PIN_OTHER1, GPIO.OUT ) GPIO.setup( PIN_OTHER2, GPIO.OUT ) GPIO.setup( PIN_GREEN, GPIO.OUT ) def setGreenPin( status ): """ Turn the Green-LED's PIN High or Low """ if ( status == True ): GPIO.output( PIN_GREEN, True ) else: GPIO.output( PIN_GREEN, False ) ### Main Loop # Set the initial state setupGPIO() setGreenPin( False ) # start with the LED off done = False green_led = False # Loop around, reading user commands until they enter 'quit' while not done: user_input = raw_input( "Colour> " ) # get input form the user # user_input = input( "Colour> " ) -- python3 user_input = user_input.strip().lower() # trim spaces, make all lower-case # What did the user say?
🌐
Python Programming
pythonprogramming.net › gpio-example-raspberry-pi
Python Programming Tutorials
First, to use GPIO, you will need to make sure you have the packages necessary on your Raspberry Pi. Via the Pi terminal, type: sudo apt-get install python-rpi.gpio
🌐
MicroPython
micropython.org
MicroPython - Python for microcontrollers
In addition to implementing a selection of core Python libraries, MicroPython includes modules such as "machine" for accessing low-level hardware. ... The pyboard is the official MicroPython microcontroller board with full support for software features. The hardware has: ... 24 GPIO on left and right edges and 5 GPIO on bottom row, plus LED and switch GPIO available on bottom row
🌐
TutorialsPoint
tutorialspoint.com › article › control-raspberry-pi-gpio-pins-using-python
Control Raspberry Pi GPIO Pins Using Python
March 27, 2026 - In this tutorial, we will explore how to use Python to control Raspberry Pi GPIO pins. We will cover the basics of GPIO programming and demonstrate how to turn on and off an LED using Python. Before we can control GPIO pins, we need to install the RPi.GPIO library.
🌐
Raspberry Pi Pod
recantha.co.uk › home › rpi.gpio python library for the raspberry pi undergoes a change
RPi.GPIO Python library for the Raspberry Pi undergoes a change - Raspberry Pi Pod
August 10, 2015 - Alex Eames has been looking at recent updates to the Python library everybody uses, RPi.GPIO, and has noticed something. The old variable RPI_REVISION has been deprecated (replaced) by something more useful: RPI_INFO. This new variable outputs a Python dictionary detailing…Read more →
🌐
gpiozero
gpiozero.readthedocs.io
gpiozero — gpiozero 2.0.1 Documentation
GPIO Zero builds on a number of underlying pin libraries, including RPi.GPIO and pigpio, each with their own benefits. You can select a particular pin library to be used, either for the whole script or per-device, according to your needs.
🌐
Phazertech
phazertech.com › tutorials › rpi-gpio.html
GPIO Python Guide
July 6, 2024 - Next you'll need to give your user permission to access the GPIO regardless of which library you installed. ... Now reboot before continuing. ... This simple program will toggle an output pin on and off. Create a new file and name it test.py: ... import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW) while True: GPIO.output(8, GPIO.HIGH) time.sleep(1) GPIO.output(8, GPIO.LOW) time.sleep(1)
🌐
GeeksforGeeks
geeksforgeeks.org › python › introduction-to-python-raspberry-pi-rpigpio-library
Introduction to Python Raspberry Pi (RPiGPIO) Library - GeeksforGeeks
July 23, 2025 - The RPi.GPIO module is a Python library that allows us to easily control the GPIO pins on a Raspberry Pi. It provides a simple interface for configuring the pins as inputs or outputs, reading their state, and controlling them.
🌐
pytz
pythonhosted.org › RPIO
Welcome to RPIO’s documentation! — RPIO 0.10.0 documentation
rpio – command-line tools for inspecting and manipulating GPIOs system-wide. ... $ curl -L https://github.com/metachris/RPIO/archive/master.tar.gz | tar -xz $ cd RPIO-master $ sudo python setup.py install
🌐
Tieske
tieske.github.io › rpi-gpio › modules › GPIO.html
Raspberry Pi GPIO module
Raspberry Pi GPIO binding for Lua. A Lua binding to the (Python) library by Ben Croston to use the GPIO from Lua.