Introduction

Pip is a package management system, used to install and manage software packages written in Python. It stands for “Preferred Installer Program” or “PIP Installs Packages.”

PIP for Python is a utility to manage PyPI package installations from the command line.

If you’re using an older version of Python on Windows, you may need to install PIP. PIP can be easily installed on Windows by downloading the installation package, opening the Command Line, and launching the installer.

This tutorial will show how to install PIP on Windows, check its version, upgrade and configure.

Note: The latest versions of Python come with PIP pre-installed,  but older versions require manual installation. The following guide is for version 3.4 and above. If you are using an older version of Python, you can upgrade Python via the Python website.

Prerequisites

  • Computer running Windows or Windows server
  • Verify Python has been installed on your computer

Step 1: Check if PIP is Already Installed

Before you install PIP on Windows, test to see if whether PIP is already installed.

Type in the following command in the Command Console:

pip help

If PIP responds, then PIP is installed; if there’s an error saying this program could not be found, then it isn’t.

PIP is automatically installed with Python 2.7.9+ and Python 3.4+.

PIP is also included in the virtualenv and pyvenv virtual environments.

Step 2: Verify Python Installation

As a Python utility, PIP requires an active Python installation. In newer versions of Python and Python-enabled virtual environments, PIP is already installed and does not need to be reinstalled.

To determine whether you have Python installed:

  • Open the Windows Command window.
  • When the console window opens, type in: python

If this command is not unrecognized, Python will need to be installed before you can install PIP.

If the command is recognized, Python will respond with its version and a list of commands.

If Python installed correctly, you should see:

Python 3.7.0 (v3.7.0:1bf9cc5093, Jan 25 2019, 07:44:31) [MSC v.1914 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

Installing PIP On Windows

Step 1: Download PIP get-pip.py

Before installing PIP, you’ll need to download get-pip.py: get-pip.py on pypa.io.

Download the file to a temporary folder in Windows or to the “Downloads” library of your Windows installation. You can download the file to anywhere but remember where it’s been saved.

Step 2: Launch Windows Command Line

Pip is a command line program. When you install PIP, a PIP command is added to your system.

To launch the Windows command line:

  • Press Windows Key + X.
  • Click on “Run.”
  • Type in “cmd.exe” and hit enter.

Alternatively, type “cmd.exe” in the Windows search bar and click on “Command Prompt.”

Both these options should open the Command Console. However, it should be noted that you may need to run the Command Console “As Administrator.” If you get an error at any point stating that you don’t have permissions to perform a task, this is generally the problem.

To run a Command Console “As Administrator,” right click on “Command Prompt” and then select the “Run as…” option.

Step 3: Installing PIP on Windows

Open the Command Console if it isn’t already open. Under the Windows command console, “cd” is the function to change directories. Use “cd” followed by a directory to navigate to the get-pip.py file.

To install PIP type in the following:

python get-pip.py

PIP should install itself. If the file isn’t found, you may need to navigate to a different directory.

You can view the contents of your current directory using the following command:

dir

The “dir” command will return a full listing of the contents of a directory.

Step 4: How to Check PIP Version

To check the current version of PIP type following command:

pip --version

This will report back the current version of the platform.

Step 5: Verify Installation

Once you’ve installed PIP, you can test whether the installation has been successful by typing the following: pip help

If PIP has been installed, the program will run, and you should see:

pip 18.0 from c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip (python 3.7)

If it hasn’t been, and you receive an error, repeat the installation process.

Step 6: Configuration

On Windows, the configuration file is: %HOME%\pip\pip.ini.

There is also a legacy per-user configuration file which is also respected and located at:  %APPDATA%\pip\pip.ini.

You can set a custom path location for this config file using the environment variable.PIP_CONFIG_FILE.

Upgrading PIP for Python on Windows

New versions of PIP are released occasionally. These versions may improve the functionality or may be required for security purposes.

You can upgrade PIP on Windows through the Command Console.

To upgrade PIP on Windows:

python -m pip install --upgrade pip

This will first uninstall the old version of PIP and then install the most current version of PIP.

Downgrade PIP Version

This may be necessary if a new version of PIP starts performing undesirably.

If you want to downgrade PIP to a prior version, you can do so by specifying the version.

To downgrade PIP, enter:

python -m pip install pip==18.1

You should now see the version of PIP that you specified.

Conclusion

Congratulations you have now installed PIP for Python on Windows.

Now that you have PIP up and running, you are ready to manage your Python packages.