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
» pip install RPi.GPIO
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
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
python 3.x - Installing pip in Raspberry pi3 - Stack Overflow
raspberry pi - Trying to install Python 3 package RPi.GPIO - Stack Overflow
[Solved] Cannot install rpi.gpio
python - RaspBerry doesn't find pip3 - Stack Overflow
Videos
sudo apt-get install python3-pip
This should install pip3 for managing Python3 libraries. If you're using rasbian that is.
python-pip is for Python2 (as of 2019-09-09) if you need that too.
pip and python are two separate entities. There for installing one doesn't necessarily mean the other will be installed.
Some good documentation on the matter can be found at raspberrypi.org
And others have asked the same question on the official forums.
Just remember, most "safe" distro's tend to default to Python2 for their LTS platforms pre 2020. Meaning you will have to essentially add python3-<lib> (the 3 being the crucial element here) to all your installations. Otherwise you'll most likely get the Python2 equivilant of the library/tool for as long as Python2 is the default python environment in your distro. Like in this case.
Again, I'm using Arch Linux ARM for the most part, so I'm not to familiar with debian/ubuntu/etc distro's for the RPi platform. But that package should be called about the same as in Arch :)
Even though Python3 install 'should' install the latest pip with it, in mho, it does not. If you have a previous version of Python it likely has the previous version of pip.
To install the latest version after installing python3:
python3 -m pip install --upgrade pip
This could lead to issues with other python versions or other programs using previous pip version.
See here on resolving the issues: https://github.com/pypa/pip/issues/5599
On linux, you could use:
sudo apt install python3-pip