Prerequisite: Introduction to Language
Python
Before we start with how to install pip for Python on Windows, let’s first look at the basic introduction to Python. Python is a widely used general-purpose high-level programming language. Python is a programming language that allows you to work quickly and integrate systems more efficiently.
PIP is a package management system used to install and manage software packages/libraries written in Python. These files are stored in a large “online repository” called Python Package Index (PyPI). pip uses PyPI as the default source for packets and their dependencies. So every time you type:
pip install package_name
pip will search for that package in PyPI and if it finds it, it will download and install the package on your local system
.
Check
if Python is installed
Run the following command to test whether Python is installed or not. If not, click here.
python -version If installed,
you will see something like this
😛 ython 3.10.0 Download and install pip
The PIP can be downloaded and installed using the command line by following these steps
:
Method 1:
Using cURL in Python
Curl is a UNIX command that is used to send PUT, GET, and POST requests to a URL. This tool is used to download files, test REST APIs, etc.
Step
1: Open the cmd terminal
Step 2: In python, a curl is a tool for transferring data requests to and from a server. Use the following command to request
:curl https://bootstrap.pypa.io/get-pip.py -o get-pip.pypython
get-pip.py Method 2: Manually install PIP
on Windows
Pip must be installed manually on Windows. You may need to use the correct version of the file from pypa.org if you are using an older version of Python or pip. Get the file and save it to a folder on your PC.
Step 1: Download the get-pip.py file (https://bootstrap.pypa.io/get-pip.py) and store it in the same directory that python is installed.
Step 2: Change the current directory path on the command line to the directory path where the previous file exists.
Step 3: get-pip.py is a bootstrap script that allows users to install pip in Python environments. Run the following command
: python get-pip.py
Step 4: Now wait for the installation process. Voilá! PIP is now installed on your system.
Verifying the installation process
You can easily check if the pip has been installed correctly by performing a version check on it. Just go to the command line and run the following command:
pip -V or pip -version
Add PIP to Windows Environment Variables
If you are facing any path error, you can follow the steps below to add the pip to your PATH. You can follow the steps below to configure the Path:
- Go to System and Security > System in the Control Panel once it has been opened
- On the left side, click the Advanced System Settings link
- Then select Environment
- Double-click the PATH variable under System Variables.
- Click New and add the directory where pip is installed, for example, C:Python33Scripts, and select OK.
.
.
Variables.
The pip update in
Windows pip can be updated using the following command. python -m pip install -U pip
Downgrading Pip on Windows
It can happen sometimes that your current version of pip pip is not compatible with your current version of python or machine so that you can downgrade your pip version with
the following command.
Note: You can mention the version you want to
install python -m pip install pip==17.0