How to Install PIP on Windows | phoenixNAP KB (2024)

Introduction

PIP is a package management system that installs and manages software packages written in Python. It stands for "Preferred Installer Program" or "Pip Installs Packages." The utility manages PyPI package installations from the command line.

Installing PIP on Windows is simple. It requires downloading the installation package, opening the command line, and launching the installer.

This tutorial will show how to install PIP on Windows using two methods. We will also show you how to check, upgrade, and configure PIP.

How to Install PIP on Windows | phoenixNAP KB (1)

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, follow our guide to upgrade Python.

Prerequisites

  • Access to Command Prompt.
  • Python installed and added to PATH.

Checking if You Have PIP Installed on Windows

PIP is automatically installed with Python 3.4.x+. However, depending on how Python was installed, PIP may not be available on the system automatically. Before installing PIP on Windows, check if it is already installed:

1. Launch the command prompt window by pressing Windows Key + X and clicking Run.

2. Type in cmd.exe and hit enter.

Alternatively, type cmd in the Windows search bar and click the "Command Prompt" icon.

3. Type the following command in the command prompt:

pip help
How to Install PIP on Windows | phoenixNAP KB (2)

If PIP responds with an error message saying the command is not recognized, follow one of the methods below to install it.

Note: Check out our other guides to learn how to install PIP on other operating systems:

  • Install PIP on CentOS
  • Install PIP on Ubuntu
  • Install PIP on Debian
  • Install PIP on Mac

Method 1: Install PIP on Windows Using get-pip.py

The first method uses cURL to download the installation file and additional configuration steps post-installation. Follow the steps below to install PIP using this method.

Step 1: Download PIP get-pip.py

Before installing PIP, download the get-pip.py file. Run the following cURL command in the command prompt:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
How to Install PIP on Windows | phoenixNAP KB (3)

Wait for the download to complete before proceeding to the next step.

Step 2: InstallingPIP on Windows

To install PIP, run the following Python command:

python get-pip.py
How to Install PIP on Windows | phoenixNAP KB (4)

Note the location from the output warning, which will be required to add PIP to the Path environment variable.

Step 3: Verify Installation

To test whether the installation was successful, type the following command:

python -m pip help
How to Install PIP on Windows | phoenixNAP KB (5)

If PIP is installed, the program runs without any errors. The output shows the software's location and a list of pip commands.

Repeat the installation process or use the second method if you receive an error.

Step 4: Add Pip to Path

To run PIP from any location and as a standalone command, add it to Windows environment variables. Doing so resolves the "not on Path" error.

To add PIP to Path, follow these steps:

1. Open the Start menu, search for Environment Variables, and press Enter.

How to Install PIP on Windows | phoenixNAP KB (6)

2. Click the Environment Variables button.

How to Install PIP on Windows | phoenixNAP KB (7)

3. Double-click the Path variable to edit it.

How to Install PIP on Windows | phoenixNAP KB (8)

4. Select New and add the directory where PIP is installed.

How to Install PIP on Windows | phoenixNAP KB (9)

5. Click OK to save the changes.

6. Open a new command prompt session and run the following command to test the changes:

pip help
How to Install PIP on Windows | phoenixNAP KB (10)

If the command does not work, try using pip3 instead of pip. Alternatively, add the directory where Python is installed to Path and repeat the process.

Step 5: Configuration

In Windows, the PIP configuration file can be found in several locations. To view the current configuration and list all possible file locations, use the following command:

pip config -v list
How to Install PIP on Windows | phoenixNAP KB (11)

The command shows the possible global, user, and site locations for the pip.ini configuration file. Below the locations are the current configuration settings, if any.

Method 2: Install PIP on Windows Using ensurepip

The second method uses Python to install PIP without downloading or running any scripts. Enter the following command in the command prompt:

python -m ensurepip --upgrade
How to Install PIP on Windows | phoenixNAP KB (12)

Wait for the installation to complete. Check that PIP is installed correctly with the following command:

pip --version
How to Install PIP on Windows | phoenixNAP KB (13)

The command outputs the PIP version to the console.

Note: If the command is not found, add Python to the Path environment variable. Or, try using the command as pip3 instead of pip.

Upgrading PIP for Python on Windows

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

To upgrade PIP on Windows, enter the following in the command prompt:

pip install --upgrade pip

This command uninstalls the previous version and then installs the most current version of PIP.

Downgrading PIP Version

Downgrading may be necessary if a new version of PIP starts performing undesirably. To downgrade PIP to a prior version, specify the version you want.

To downgrade PIP, use the following syntax:

python -m pip install pip==[version_number]

For example, to downgrade to version 18.1, run:

python -m pip install pip==18.1
How to Install PIP on Windows | phoenixNAP KB (14)

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

Note: Learn how to update packages using winget upgrade command.

Conclusion

After reading this guide, you've installed PIP and can manage your Python packages on Windows.

Next, check out our guide and learn how to install NumPy using PIP.

How to Install PIP on Windows | phoenixNAP KB (2024)
Top Articles
Latest Posts
Article information

Author: Carlyn Walter

Last Updated:

Views: 5463

Rating: 5 / 5 (50 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Carlyn Walter

Birthday: 1996-01-03

Address: Suite 452 40815 Denyse Extensions, Sengermouth, OR 42374

Phone: +8501809515404

Job: Manufacturing Technician

Hobby: Table tennis, Archery, Vacation, Metal detecting, Yo-yoing, Crocheting, Creative writing

Introduction: My name is Carlyn Walter, I am a lively, glamorous, healthy, clean, powerful, calm, combative person who loves writing and wants to share my knowledge and understanding with you.