Do you need support in installing PIP on Windows? This guide will help you.
PIP is basically a package manager for Python packages or modules.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform Windows-related Software installations.
In this context, we shall look into how to install PIP on Windows.
More about PIP?
PIP stands for "preferred installer program" or "Pip Installs Packages". It is very useful in the installation and management Python packages.
Additionally, it helps in enabling 3rd package installations and used by various applications.
In Python version 3.4 or later, PIP is included by default.
Steps to install PIP on Windows?
To install PIP, follow the following steps;
1. Check if the PIP is already installed
As previously stated, by default, PIP is installed in much newer Python builds. So we need to check if it is already installed on the system or not.
Below is the command that you can execute to check its installation;
If the PIP is already present on the system then you will receive a message that explains how to use the program. In case, if it is not then you will receive an error stating ‘program is not found’.
2. Confirm Python installation
The next step is to check Python installation on the system. For that, you can simply open the command prompt and type python, and hit Enter. If Python is installed on the server then you must receive an output with the Python version.
But in case, if you receive an error message "Python is not recognized as an internal or external command" then it means that the Python is either not installed or the system variable path has not been set.
So you would need to launch the Python from the folder in which it is installed. Or else you would need to freshly install it.
3. How to Install PIP on Windows?
After confirming that Python is installed on the system, we can now install PIP. Here are the steps to do it;
i. Start by downloading the file "get-pip.py" to a folder on your computer from the URL https://bootstrap.pypa.io/get-pip.py.
ii. Next, open the command prompt and access the folder containing the get-pip.py installer.
iii. Finally, run the following command;
Now, the PIP must be installed successfully on the system. In case, if you receive an error "file not found" then double-check the directory path of the file. Make use of the dir command to view the contents of the directory.
4. How to Verify the installation and check the PIP version?
Once the installation is completed, you need to verify the installation. To do this, execute the below command in the command prompt;
You will see an output stating the PIP version.
5. Using PIP to manage Python Packages
After installing and configuring PIP, we can now use it to manage the Python packages. For that, you can run the following command that will provide you a brief overview of the commands available and syntax for PIP.
6. How to Configure PIP?
You can find the PIP configuration file at the path "%HOME%\pip\pip.ini".
Also, it contains a legacy per-user configuration file. This file is located at "%APPDATA%\pip\pip.ini".
Additionally, you can specify a custom path location for this config file using the environment variable PIP_CONFIG_FILE.
How to Upgrade PIP?
You can upgrade PIP to take advantage of the latest features and security fixes. To accomplish this, just open the command prompt and run the following command;
python -m pip install --upgrade pip
The above command will uninstall the older version of PIP and installs the latest one.
How to Downgrade PIP?
Sometimes, you may need to downgrade the PIP version due to compatibility issues. For doing so, run the below command in the command prompt(use the version number as you prefer).
python -m pip install pip==18.0
Now, PIP will successfully downgrade. Also, you can confirm the version by running the below command.