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
🌐
Geekworm Wiki
wiki.geekworm.com › How_to_Install_RPi.GPIO_Python_Library
How to Install RPi.GPIO Python Library - Geekworm Wiki
import RPi.GPIO as GPIO # to use Raspberry Pi board pin numbers GPIO.setmode(GPIO.BOARD) # set up the GPIO channels - one input and one output GPIO.setup(11, GPIO.IN) GPIO.setup(12, GPIO.OUT) # input from pin 11 input_value = GPIO.input(11) # output to pin 12 GPIO.output(12, GPIO.HIGH) # the same script as above but using BCM GPIO 00..nn numbers GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.IN) GPIO.setup(18, GPIO.OUT) input_value = GPIO.input(17) GPIO.output(18, GPIO.HIGH) ‎ ·
Discussions

python 3.x - Import RPi.GPIO as GPIO ImportError: no module 'RPi' - Stack Overflow
I wrote a small text to control my fan that is on my raspberry pi 3 version B. After running the program it came up with an error: 'pi@raspberrypi:~/Development $ Sudo python3.5 run-fan.py trace... More on stackoverflow.com
🌐 stackoverflow.com
[deleted by user]
Thank you for this write up. I’m looking to deploy a small HA instance to monitor my neighbor’s sump pump. I only need 4 binary sensors and was planning to use one of the GeeekPi Micro GPIO Terminal Block Breakout Boards from Amazon to interface to the Pi. Do you think I can run Tailscale on the Pi for remote access? I’m curious if the Pi 3B+ is strong enough for a very small HA deployment. More on reddit.com
🌐 r/homeassistant
4
8
November 16, 2023
Trouble with RPi.GPIO
A couple thoughts: Do you have the library installed on the Pi? Try this code: try: import RPi.GPIO as GPIO except RuntimeError: print("Error importing RPi.GPIO!") What OS do you have on the Pi? Bookworm now messes up Python by using virtual environments (venv) and this could possible be the cause. I think Bookworm (on all boards) has also changed the method of GPIO access and you should use GPIO Zero or gpiod. For the first see https://gpiozero.readthedocs.io/en/latest/ and the second see https://www.tomshardware.com/how-to/control-raspberry-pi-5-gpio-with-python-3 I honestly cannot remember if autocomplete needs the module installed on the local machine as well as the remote - I'm on a iPad at the mo so cannot run VSC at the mo to check :-( Possibly see that the Python version is pointing to the Pi and not your local machine. More on reddit.com
🌐 r/raspberry_pi
5
2
November 13, 2023
Problem with PLUGINS *RPio_GPIO* This module can only be run on a RASPBERRY
It's impossible to install any plugin that requires access to the Raspberry Pi GPIO on another device because it doesn't exist. You can't do anything about that. There is no point in installing a filament sensor plugin that expects the sensor to be connected to the GPIO on a device that doesn't have GPIO pins. More on reddit.com
🌐 r/octoprint
6
0
July 19, 2022
🌐
PyPI
pypi.org › project › RPi.GPIO
RPi.GPIO · PyPI
Download URL: RPi.GPIO-0.7.1-cp39-cp39-linux_armv6l.whl ... Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/30.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.2.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.2
      » pip install RPi.GPIO
    
Published   Feb 06, 2022
Version   0.7.1
🌐
RasPi.TV
raspi.tv › 2013 › rpi-gpio-basics-5-setting-up-and-using-outputs-with-rpi-gpio
RPi.GPIO basics 5 – Setting up and using outputs with RPi.GPIO
June 22, 2015 - You can do this by treating it as an input port. GPIO.input(24) Let’s modify the LED script to read the status of GPIO24 (lines 10-11 & 14-15) and give us a message about the LED’s status.
🌐
SparkFun Learn
learn.sparkfun.com › tutorials › raspberry-gpio › python-rpigpio-example
Python (RPi.GPIO) Example - Raspberry gPIo - SparkFun Learn
This assumes you've set up the circuit as arranged on the Hardware Setup page. 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 ...
🌐
SourceForge
sourceforge.net › home › browse › raspberry-gpio-python › wiki
raspberry-gpio-python / Wiki / BasicUsage
By doing it this way, you can refer to it as just GPIO through the rest of your script. To import the module and check to see if it is successful: try: import RPi.GPIO as GPIO except RuntimeError: print("Error importing RPi.GPIO! This is probably because you need superuser privileges.
Find elsewhere
🌐
SparkFun Learn
learn.sparkfun.com › tutorials › raspberry-gpio › python-rpigpio-api
Python (RPi.GPIO) API - Raspberry gPIo - SparkFun Learn
To specify in your code which number-system is being used, use the GPIO.setmode() function. For example... ... Both the import and setmode lines of code are required, if you want to use Python. If you've used Arduino, you're probably familiar with the fact that you have to declare a "pin mode" before you can use it as either an input or output.
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
RPi.GPIO Module Not found - Raspberry Pi Forums
Tue Feb 01, 2022 5:21 am My Mind Is Screaming in confusion and frustration at the sight of (ImportError: No module named RPi.GPIO) What is the context for your frustration? What model of RPi board? What Operating System is installed on the microSD card (or other boot medium)? The Python RPi.GPIO library has been a standard pre-installed component of RasPiOS (previously known as 'Raspbian') for years - it should not need to be installed.
🌐
Ubuntu
ubuntu.com › tutorials › gpio-on-raspberry-pi
How to use Raspberry Pi GPIO pins with Ubuntu | Ubuntu
See the wiring diagram below as an example: After connecting the fan and Raspberry Pi, run the following Python script to control the speed of the fan with PWM. # Control a 5V PWM fan speed with the lgpio library # Uses lgpio library, compatible with kernel 5.11 # Author: William 'jawn-smith' Wilson import lgpio import time # Configuration FAN = 18 # pin used to drive PWM fan FREQ = 10000 h = lgpio.gpiochip_open(0) try: while True: # Turn the fan off lgpio.tx_pwm(h, FAN, FREQ, 0) time.sleep(10) # Turn the fan to medium speed lgpio.tx_pwm(h, FAN, FREQ, 50) time.sleep(10) # Turn the fan to max speed lgpio.tx_pwm(h, FAN, FREQ, 100) time.sleep(10) except KeyboardInterrupt: # Turn the fan to medium speed lgpio.tx_pwm(h, FAN, FREQ, 50) lgpio.gpiochip_close(h)
🌐
Phazertech
phazertech.com › tutorials › rpi-gpio.html
GPIO Python Guide
July 6, 2024 - Double check everything's connected correctly, then copy and paste the following code into a new Python file and run it: import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW) GPIO.setup(10, GPIO.IN) while True: if ...
🌐
pytz
pythonhosted.org › RPIO
Welcome to RPIO’s documentation! — RPIO 0.10.0 documentation
... $ curl -L https://github.com/metachris/RPIO/archive/master.tar.gz | tar -xz $ cd RPIO-master $ sudo python setup.py install · Debian packages are available at metachris.github.com/rpio/download. After the installation you can use import RPIO as well as the command-line tool rpio.
🌐
gpiozero
gpiozero.readthedocs.io › en › stable › migrating_from_rpigpio.html
11. Migrating from RPi.GPIO — gpiozero 2.0.1 Documentation
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) def pressed(pin): print("button was pressed") def released(pin): print("button was released") GPIO.setup(4, GPIO.IN, GPIO.PUD_UP) GPIO.add_event_detect(4, GPIO.FALLING, pressed) GPIO.add_event_detect(4, GPIO.RISING, released)
🌐
Caretech
caretech.io › 2018 › 01 › 20 › using-the-rpi-gpio-module-with-python-3
Using the RPi.GPIO module with Python 3 – CareTech Computing
Presently the whole script is as follows: # Import necessary modules import RPi.GPIO as GPIO import time # Set up GPIO pins GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) pins = [17,18] for pin in pins: GPIO.setup(pin,GPIO.OUT) GPIO.output(pin,1) # Set variables (change these to change behaviour as desired) runcycles = 2 ontime = 45 # minutes offtime = 20 # minutes # Convert run times from minutes to seconds for sleep function ontime *= 60 offtime *= 60 # Run furnace on cycle cycle = 0 try: while cycle < runcycles: cycle += 1 GPIO.output(17,0) print("Furnace turned on for %d seconds.
🌐
Raspberry Pi Spy
raspberrypi-spy.co.uk › home › python › install rpi.gpio python library
Install RPi.GPIO Python Library - Raspberry Pi Spy
February 16, 2015 - hi, i am using the Raspberry pi desktop and rpi.gpio is already installed in it but the python keeps throwing error of no found RPi.GPIO module, i dont have raspberry pi board so just wanted to code and practice with interpreter, please help. ... Because there are no physical GPIO pins when using Raspbian on a PC/laptop you can’t use the GPIO library. It is possible to connect a Pi Zero to act as a “GPIO expander” so you can write code on a PC.
🌐
piwheels
piwheels.org › project › rpi-gpio
piwheels - RPi.GPIO
September 3, 2025 - A module to control Raspberry Pi GPIO channels · In a virtualenv (see these instructions if you need to create one): pip3 install rpi-gpio · None · PyPI page · pypi.org/ project/ rpi-gpio · Project JSON · piwheels.org/ project/ rpi-gpio/ ...
🌐
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.
🌐
SourceForge
sourceforge.net › home › browse › raspberry-gpio-python › wiki
raspberry-gpio-python / Wiki / Home
you can test the capital ones like this : python -c 'import RPi.GPIO as GPIO; print(GPIO.VERSION)'
🌐
ICS
ics.com › blog › control-raspberry-pi-gpio-pins-python
Control Raspberry Pi GPIO Pins from Python | ICS
July 31, 2019 - The RPi.GPIO module is installed by default on recent versions of Raspbian Linux. To use the module from Python programs, first import it using:
🌐
Adafruit
forums.adafruit.com › forums index › electronics › general project help
pylint bugs on basic import RPi.GPIO as GPIO on raspi 4b - adafruit industries
February 13, 2024 - Use with caution in scripts. python3-rpi.gpio/stable,now 0.7.1~a4-1+b4 arm64 [installed] python3-rpi.gpio/stable 0.7.1~a4-1+b4 armhf rpi.gpio-common/stable,now 0.7.1~a4-1+b4 arm64 [installed,automatic] rpi.gpio-common/stable 0.7.1~a4-1+b4 armhf (env) garberw@nickel ---->>>> this shows that a pip3 package is ALSO installed (by blinka ????): ... (env) garberw@nickel ---->>>> python -m pip list -v | grep RPi RPi.GPIO 0.7.1 /home/garberw/env/lib/python3.11/site-packages pip (env) garberw@nickel ---->>>> maybe there is some kind of conflict ????