monovm

Follow MonoVM
on social networks
and stay updated
with our new posts.

instagram twitter linkedin Youtube facebook telegram
English
+370 5 205 5502 sales@monovm.com

How to Install PIP on Windows/Linux? [A Complete Guide]

This blog post is about how to install pip on windows and Linux, and why you need PIP.

05 Mar, 23 by Antoniy Yushkevych 7 min Read

List of content you will read in this article:

In this article, we will learn how to install PIP on Windows and Linux operating systems, but first, we should know why we need PIP. When you are dealing with Python, there is a requirement for tons of packages. You can use the available ones with the help of the default package manager; however, PIP might be required to install some. with PIP or Package Installer for Python, You can install the software packages or libraries that are not included in the Python Standard Library.

Moreover, if you seek to install additional dependencies or packages, you can simply install PIP on Windows and Linux operating systems. PIP uses Python Package Index for all the packages. You must be familiar with the term package manager if you know the programming world. This tutorial will guide you on how to install PIP on Windows and Linux.

Let us now head towards the process of installing PIP in Windows first!

Let's move to understanding the complete step/procedure.

  • The first step is to check whether PIP is installed on your desktop or not to install PIP on Windows.
  • To check that, simply go to your command prompt, and write the following:

pip help

  • Now, If a response occurs, that’s a clear indication that your system has already PIP installed. If it doesn’t, an error message appears on the screen, ‘program could not be found.
  • Next up is the verification of the Python installation. PIP needs an active Python installation in the system. To confirm whether you have Python already installed or not, head on to the command prompt window and type:

python 

  • If the command goes unresponsive and nothing shows on the screen, you need to install Python before installing PIP.
  • Once you install Python, this is what your screen is going to display. Take a look:

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.

Let us quickly understand how to install PIP on the Windows process. 

Follow these steps to achieve your task:

Step 1: You need to download PIP get-pip.py

You have to download get-pip.py before installing PIP. Now, remember the location where you save the file as this path is required in the process later.

Step 2: Open the Windows Command Line

The next step is to open the Command prompt window. Simply follow these steps:

    • Select Windows key + X
    • Hit run
    • Now type cmd.exe 

If not these steps, you can simply type cmd in the search bar, and the command prompt will be displayed on your screen.

Additionally, there are instances where you have to run/access the prompt window as an administrator. Now, when can you encounter these situations? Sometimes, while you perform a task, you may encounter a message saying that you do not have access to some specific permissions to run an application or a program. In such situations, you are required to run the app as an admin.

To conclude, click right on the Command Prompt and choose ‘Run as,’ then select As Administrator. And you’re done!

Step 3: Install PIP on Windows

Now, open the Command Prompt, type the cd command, and then the path where you saved the get-pip.py file. Remember?

Cross-check the file’s path, as this can later cause a problem in the installation process.

Now, follow this command:

python get-pip.py

After this, the installation process begins. 

Moving on, to display the list of your current directory, type:

dir

Step 4: Check the PIP version

If you wish to see the version of your PIP, go to the Command Prompt and type the following command:

pip --version

The current version is displayed on the screen.

Step 5: Installation verification

As you had earlier initiated the installation process, you can now check whether the process is successful.

pip help

If your installation is successful, you will encounter this message.

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

If not, kindly repeat your installation.

Step 6: How to configure?

The PIP configuration file in Windows is %HOME%\pip\pip.ini located at %APPDATA%\pip\pip.ini. Now, if you want to set the location as per your wish, use PIP_Config_File.

Moreover, if you wish to upgrade your PIP version, you can do that. It discards the older version and installs the latest one. To accomplish this task, type the following command:

python -m pip install --upgrade pip

Moving onto the last segment, what if you want to downgrade the installed PIP version in your system? Well, you may think, why is this necessary? 

Well, there are times when you install a new version, and it does not work seamlessly. To sort that issue, you need to downgrade the version to revert to the previously installed version. Use this command:

python -m pip install pip==18.1

That’s it! Yes, it is this simple process through which you can install PIP on Windows. Let us head toward our next segment.

Now, Python Package Index is used by PIP as the default source for the packages. Hence, when you type, 

pip install package_name

This command scans for the mentioned package in PyPI. As soon as it finds the package, it downloads and installs it. It depends on which version, either Python pip or Python3-pip, you’re working with. 

Here is a step-by-step guide to the whole process screenshot.

Step 1: Start by typing the following command:

Sudo apt-get install python3-pip python-dev

Step 2: Next up, you will see this window.

Here, the installer is simply providing the disk space.

Step 3: Next, it downloads the libraries as shown below.

Step 4: Now, all the files and packages start unpacking.

Step 5: Lastly, the few more steps of the installation look like this.

General syntax:

root@ubuntu:~# pip3 install <package name>

As we have taken the example of the Numpy library, just write NumPy in the place of the package name. Here is how:

root@ubuntu:~# pip3 install numpy

Step 6: Moving on, let’s say you want to search for the availability of some packages. Use this command:

root@ubuntu:~# pip3 search numpy

Step 7: Next, to know all the Python packages installed in the system, follow this command:

root@ubuntu:~# pip3 list 

To gain any additional information about the installed packages, use the following:

root@ubuntu:~# pip3 show numpy

Step 8: Now, finally, if you wish to uninstall the packages, use this simple command:

root@ubuntu:~# pip3 uninstall numpy

That’s it! 

We hope that with the help of this article, you have successfully learned how to install PIP on Windows and Linux operating systems. You can now easily manage your packages with the help of Python PIP. If you face any issues during the installation or have questions, please leave them in the comment box below.

Keep learning and Keep Sharing!

Antoniy Yushkevych

Master of word when it comes to technology, internet and privacy. I'm also your usual guy that always aims for the best result and takes a skateboard to work. If you need me, you will find me at the office's Counter-Strike championships on Fridays or at a.yushkevych@monovm.com