How to Install PIP on Windows

PIP is an application management system for installing and managing Python-based packages of software. This is a word that stands for ‘preferred installer program’ or ‘Pip Installs Packages.’ PIP for Python is a command-line application for managing PyPI package installs. 

PIP may be required when running a previous Python version on Windows. PIP is simple to install on Windows using downloading the file in the installation package, opening the Windows command prompt, and running the installer program. 

This guide will show you the proper way to install PIP on Windows and how to verify its version, upgrade, and customize it.

How to Install PIP On Windows

For installation of Pip on Windows, you must first install Python. Pip is side loaded on Windows when you install Python through your computer’s setup file. Here’s how to install Pip on Windows. Follow the given ways.

Check If Python Is Available

To check if Python is installed on our system, open the command prompt in Windows run, type CMD, and click Enter. Open Command Prompt by right-clicking on the Start menu, choosing Windows PowerShell, typing Python, and pressing Enter.

Install PIP on Windows
Install PIP on Windows

When Python is correctly installed, we will receive a message similar to the one as follows:

Python 3.10.2 (tags/v3.10.2:a58ebcc, June 7 2024, 14:12:15) [MSC v.1929 64 bit (AMD64)] on win32 Type "help," "copyright," "credits," or "license" for more information.

In the alternative case in point, users will get the following notification:

  • Python is not recognized as an external or internal command, executable program, or batch file.

This indicates that Python is either incorrectly installed on the computer we are using or that it was installed wrongly and requires system settings to be specified.

Check If PIP Is Already Installed

Given that we have confirmed that Python has been installed on Windows, we’re going to see whether PIP is already installed.

Python 3.4+ and Python 2.7.9+, together with the desktop environments ‘virtualenv‘ and 'pyvenv‘, are included with PIP by default; we can verify our version of Python in the command prompt. However, previous versions of Python do not have this benefit by default.

When we use a previous Python release and cannot upgrade it for any reason, we may be required to download and install PIP on Windows personally.

  1. To verify that PIP has been installed on Windows, go to the command prompt again, type pip, and click Enter.
  2. Once PIP has been installed, users will receive a lengthy message detailing the application’s operation and all of the options for commands and settings. In any case, if PIP fails to be installed, the result is the following:
  3. ‘pip’ cannot be recognized as an internal or external command, executable program, or batch file.
  4. This will happen precisely once we manually set up PIP on Windows.

Download PIP get-pip.py

While we can install PIP, we must first download the get-pip.py file. We have two methods.

Method-1

  1. Go to the link https://bootstrap.pypa.io/get-pip.py then download it as get-pip.py into the same folder as Python.
  2. Generally, the Python installer is saved in the AppData folder. The complete get can appear like this.
  3. C:\Users\User\AppData\Local\Programs\Python\Python310
  4. The folder to which the User may be linked on each system and the most recent folder in the previous path will depend on the current version of Python. Python 3.10 in our scenario.

Method-2

  1. Curl is a UNIX command that sends PUT, GET, and requests for POST to URLs. This tool is used to download files, test REST APIs, etc.
  2. Run the command prompt and use the command cd to get to the folder where Python is located.
  3. Now execute the curl command.
  4. curl -o get-pip.py https://bootstrap.pypa.io/get-pip.py.
  5. python get-pip.py.

Installing PIP on Windows

We need to execute the following procedures now that we have downloaded the get-pip.py file.

  1. Start the command prompt.
  2. Proceed to the folder containing Python and the get-pip.py file using the cd command.
  3. Run the following command to start the installer.
  4. get-pip.py in Python.
  5. Once a brief installation is completed, a notification displays all of the installation data, and the last line looks like the following.
  6. Successfully installed pip-22.0.1 wheel-0.37.1.
  7. Now PIP has been successfully installed on Windows.

Verify Installation

To confirm the PIP’s installation and version, use the command prompt to execute one of the following commands.

pip --version or pip –V

Once PIP is successfully installed, you will receive a notification identifying the latest version of PIP and its place on the local system, such as.

pip 22.0.2 from C:\Users\Utente\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10).

Once an error happens, the installation must restart the installation.

How to Add Pip to Windows Environment Variables

Executing PIP using any folder in the command prompt instead of having to go to the folder in which the PIP installer is placed. We must add the location of the folder containing the get-pip.py file using Windows environment variables.

This can be particularly important when we have installed many versions of Python, even older versions. Instead of installing PIP manually for each out-of-date version of Python, you need to install it simply for any one of them and then proceed as follows.

  1. Go to Control Panel by searching for it in Windows; choose System and Security, then the System option.
  2. Choose advanced system settings at the bottom of the opening window.
  3. Go to the Environment Variables option.
  4. Identify and double-click on the variable Path inside the System variables tab.
  5. Select New and provide the path to the PIP installer’s location.
  6. To confirm the changes, click the OK button.

Configuration

  1. The PIP setup file can be located in %HOME%\pip\pip.ini.
  2. Pip also includes a per-user legacy setup file. This file may be found in %APPDATA%\pip\pip.ini.
  3. The environment variable PIP_CONFIG_FILE can also be used to give a specific path location for this setup file.

How to Upgrading PIP for Python on Windows

We may have to upgrade PIP on Windows to the current version from time to time to continue keeping it updated to date and running smoothly. To do this, we may use the command prompt to execute a specific command.

python -m pip install --upgrade pip

In that case, the previous PIP version will be removed, and the latest version will now be installed.

How to Downgrade PIP Version

People may also choose to downgrade PIP to a previous version. This type of action can be required in specific situations, such as when a new version finds connectivity problems. To downgrade PIP on Windows, start the command prompt and enter a particular command.

python -m pip install pip= =<version>

Assume we would like to downgrade to v20.0. The actual command is going to be:

python -m pip install pip==20.0

We can check that we may, at present, have the required version of PIP after downgrading it.

python -V.

How can I set up pip on Windows?

  1. Go to System and Security and System in the Control Panel.
  2. On the left side, choose the Advanced System settings option.
  3. Select Environment Variables from the drop-down menu.
  4. Double-click the variable PATH below the System Variables option.

*Disclaimer: The Content we produce on this page will be only such as advice or readable information. We provide the content on the page after getting it from different sources at that time. Still, the changes from time to time, like contact information such as phone numbers, email IDs, web links and any other about that product in any form, are not responsible to us. We provide the information you need and are not an authentic source. You may refer to the original/official website/page for further clarification and more info on that product.