You need to run Python as an elevated process in order to have write access to the program files directory where pip will get installed. The simplest and best way to do that is to launch an elevated command prompt cmd.exe
.
In Windows 7 and later, you can best do that by opening the start menu using the Windows key, and then typing cmd
. This should give you the command prompt as the first result. Right click on it, and choose “Run as administrator”. After accepting the UAC dialogue, this will then start an elevated command prompt with proper write access.
The run the script, then use the following command as explained in the pip installation manual:
python get-pip.py
Of course you need to adjust the path to the get-pip.py
file. For example if the file is in your downloads folder, you can write the following:
python C:\Users\<username>\Downloads\get-pip.py
This should the properly install pip for the current Python version.
Note that in order to use pip later, you also need to run it always from an elevated command prompt, as every PyPI module is also installed into the Python directory in your program files (unless you’re using virtual environments of course). So you then need to run e.g. pip install beautifulsoup4
. If pip.exe
is not in your path, which likely be the case, you can also run pip using the Python executable like this: python -m pip install beautifulsoup4
.