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 ExchangeNot 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
Assuming you have pip, the python package index installer, which is installed on the latest versions of Raspbian by default
You can use:
sudo pip install RPi.GPIO for Python 2
and
sudo pip-3.2 install RPi.GPIO for Python 3
[Solved] Cannot install rpi.gpio
Python vs Python3 apt install
python - No module named RPi.GPIO even though it's installed - Raspberry Pi Stack Exchange
Errors when installing on a Raspberry Pi running Bullseye
I was able to fix the issue by installing RPi.gpio using pip3. Type the following commands:
export CFLAGS=-fcommon
pip3 install RPi.GPIO
Source: https://www.raspberrypi.org/forums/viewtopic.php?t=289084
As of version 20.10, Ubuntu does not come with Python 2 installed as it is deprecated. It does have python 3. You use python3 to run python and pip3 to install modules.
» pip install RPi.GPIO