Installing pip on Windows
Tags: python, django, webdev
Published: 2017-07-19 23:00:01

---
title: Installing pip on Windows
published: true
description: How to install pip-python on windows
tags: python,django,webdev
---


<strong>Note:</strong> <i>"the newest versions of python comes with pip but older version has to be installed by the user.</i>"



Before you install pip on your computer, make sure python has been installed on your computer.  You can verify this by opening a command prompt terminal (CMD) on windows using search in Windows 7. Then click the Command Prompt search result. 



For Windows 8.1, switch to the Start screen and type command or cmd.
In Windows 10, you can use Cortana to search for, and launch the Command Prompt terminal. Inside Cortana's search field, enter command or cmd. Then click or tap on the Command Prompt result. 

Another way to launch the Command Prompt is to use the Run Window (press Win+R) on your keyboard and type in CMD, press enter or OK to open it.


In your command prompt terminal, type in
> python

and what you get should look like this:


><i>Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.</strong></i>



If you get an error message like this:

><i>python is not recognized as an internal or external command, operable program or batch file.<i> 


Then it means that python has not been installed on your computer or probably python is not saved in the path environment variable of your computer, so you cannot run Python from any location without having to constantly reference the full installation path name. Make sure to check my write-up on how to install python on windows.


To install pip, download <strong>get-pip.py</strong> via <em>https://bootstrap.pypa.io/get-pip.py</em> to a directory on your computer.

<strong>Note:</strong> Your browser might open the code for you, just copy and paste the python code into a fresh python IDLE (GUI), then save it as <strong>get-pip.py</strong>


After that, navigate into the directory in your command prompt window and run 
>python get-pip.py.

To verify a successful installation in your command prompt, navigate into C:\Python27\Scripts, then run 
>pip --version

you should get:
><em>pip 9.0.1 from c:\python27\lib\site-packages (python 2.7) </em>

By now, you have successfully installed pip on your computer, but there is one more step to go! You need to save pip in the path environment so that you can run pip from any location without having to constantly reference the full installation path name as it was earlier referenced in <em><strong>c:\Python27\Scripts.</strong></em>


Use the search on windows 7 and 8, or Cortana in windows 10 to find environment variables. Another way to get to the environment variables is by using the file explorer and locate This PC. Right click and select properties, the control panel home as shown below will open. Click the <strong>Advanced system settings</strong>.

<img src="https://thepracticaldev.s3.amazonaws.com/i/3jiihwrn0mqu6s39i7yx.png">


When you click on edit the <strong>system environment variables</strong>, you should see:
<img src="https://thepracticaldev.s3.amazonaws.com/i/7pm3n5ndwmz5oddfn01z.png">
 
When you click on <strong>environment variables</strong>, you get something like this:
<img src="https://thepracticaldev.s3.amazonaws.com/i/umslp0xjckm7p62rfnh3.png">
 

Find the system variable called path, then click edit. Create a new variable, add the pip installed directory <strong>C:\Python27\Scripts </strong>into the new environment variable and click OK.
<img src="https://thepracticaldev.s3.amazonaws.com/i/i1gv8f24z8qk6n8oq5oo.png">

To verify the creation of a new environment variable, open your CMD terminal and run this:
>pip --version 

It will show you the pip version installed on your computer and you should see this:
><em>Pip 9.0.1 from c:\python27\lib\site-packages (python 2.7). </em>

<strong>Note:</strong> the version of the pip install might vary with time as updates are being made.

Finally, run pip freeze to verify all the packages installed with pip
The result will be: 
><em>
astroid==1.4.9
autopep8==1.3.1
backports.functools-lru-cache==1.3
colorama==0.3.7
configparser==3.5.0
Django==1.8
isort==4.2.5
lazy-object-proxy==1.2.2
mccabe==0.6.1
pycodestyle==2.3.1
pylint==1.6.5
six==1.10.0
virtualenv==15.1.0
wrapt==1.10.10
yapf==0.16.1
</em>



Written by Timothy Fehintolu.
Follow on twitter @el_joft




IF YOU LIKED THE POST, THEN YOU CAN BUY ME MY FIRST COFFEE EVER, THANKS IN ADVANCE.

<a href="https://www.buymeacoffee.com/eljoft" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>