You can't, RPi.GPIO only works on the Raspberry Pi.
Answer from joan on Stack Exchange
» pip install RPi.GPIO
python - gpio library on windows while developing - Raspberry Pi Stack Exchange
python - How to install RPi.GPIO to windows - Stack Overflow
How to correctly install the python RPi.GPIO library - Raspberry Pi Stack Exchange
raspberry pi - Trying to install Python 3 package RPi.GPIO - Stack Overflow
Videos
You can't, RPi.GPIO only works on the Raspberry Pi.
If you are just looking to test the whole code and not worry about the actual pins (as windows machines don't have GPIO), then you can fake it.
First, in your main python source directory, create a directory named "RPi". In that folder, put an empty text file named __init__.py. This lets python know the folder "RPi" is a package. Also in that folder put a text file named "GPIO.py". In that file put the following:
BOARD = 1
OUT = 1
IN = 1
def setmode(a):
print a
def setup(a, b):
print a
def output(a, b):
print a
def cleanup():
print 'a'
def setwarnings(flag):
print 'False'
This puts a pretty blank attribute set that can answer some of the GPIO calls you would most likely be using. Of course, there is no way to actually check whether the calls worked, but you won't get error messages stating the module GPIO doesn't exist. It's pretty hacky, but I use it when I don't feel like ssh into my pi for some quick code updates. You can add any other GPIO attributes you may need.
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