How To Install Pip In Windows?


Pip is a tool used to install Python packages and modules to the operating system. Pip is a cross-platform tool where the same commands can be used for both Linux, Windows, MacOSX, etc. In this tutorial, we will install Pip on Windows in different ways.

Download and Install Python

In order to install Pip, the Python should be already installed. We can install Python with the following installation file which is for Python3.

https://www.python.org/ftp/python/3.7.4/python-3.7.4-amd64.exe

After clicking the installation file we will see the following screen where we can provide some installation configuration. Before clicking Install Now to start installation we will check the Add Python 3.7 to PATH which is useful to run python command from the command line in any path.

Python Installation
Python Installation

We will be asked to provide administrative rights to the installation process. We will click to Yes.

The setup process will not take soo much time.

At the end of the successful installation, we will see the following screen. We can simply click to the Close button.

Python Installation Successful
Python Installation Successful

Check Python Installation

We can check the installed Python version in different ways. For Windows, we can use python command or python command with the --version option which will print installed python version in detail. python command will start a python interactive shell which will also print installed python version. We can exit from the shell with exit() function.

Check Python Installation
Check Python Installation

Use Python3 Provided Pip Tool

Python 3 provides the pip tool by default. But the tool is installed to the User home path like below. But keep in mind that in this example the user is İsmail Baydan but it should be changed according to your user.

C:\Users\İsmail Baydan\AppData\Local\Programs\Python\Python37\Scripts
Use Python3 Provided Pip Tool

We can navigate to this directly to this path and use the pip command like below.

> cd C:\Users\İsmail Baydan\AppData\Local\Programs\Python\Python37\Scripts

> pip3.exe -V

Install Pip with Get-Pip.py Script On Windows

In order to install Pip for Windows get-pip.py Python script is provided by pypa.io web site. We will download this Python script and run in the command line. While installing the pip via get-pip.py script we can provide --no-setuptools option to prevent setup tools installation and --no-wheel to prevent wheel installation.

LEARN MORE  How To Convert Python String To Int?

We will get the script with curl command or just right click and download. With curl command which is available for Windows 10, Windows Server 2016, Windows Server 2019.

> curl https://bootstrap.pypa.io/get-pip.py > get-pip.py
Install Pip with Get-Pip.py Script On Windows
Install Pip with Get-Pip.py Script On Windows

OR with PowerShell Start-BitsTransfer command like below.

PS> Start-BitsTransfer -Source http://bootstrap.pypa.io/get-pip.py -Destination get-pip.py

We will start the installation by using python command and providing the downloaded script file get-pip.py like below.

> python get-pip.py
Install Pip with Get-Pip.py Script On Windows
Install Pip with Get-Pip.py Script On Windows

Check Installed Pip Version

After installing pip we can check its version. We can use the --version option in order to print the currently installed Pip version.

> pip --version

Upgrade/Update Pip By Using Pip Command (Itself)

We can update or upgrade already install pip command with the -U option and provide the pip as package name.

> pip -U pip

Install Behind the Proxy

If we are in a corporate where it uses some proxy for internet traffic control we need to provide some proxy information in order to access and download the Pip package. We will use --proxy configuration with the proxy address, port, username, and password.

> python get-pip.py --proxy="http://[user:[email protected]]proxy.server:port"

Search/Find A Package with Pip Command

We can use the search command of Pip in order to search and find a package or list multiple packages that are related to the search term. In this example, we will search the package named django.

> pip search django

Install Package with Pip

We can install a package with the install Pip command. In this example, we will install the package named django like below.

> pip install django

Uninstall A Package with Pip

We can uninstall the installed package with the uninstall command of Pip. In this example, we will uninstall the package named django.

> pip uninstall django

1 thought on “How To Install Pip In Windows?”

Leave a Comment