In this article, we will discuss how to install a PIP package in the widnows. PIP is the default package manager for the Python programming language.
It is used to install and manage software packages written in Python. PIP is a recursive acronym that stands for “PIP Installs Packages” or “Preferred Installer Program”.
The PIP is the use to handle binary packages over the easy_install packaged manager, Pip enables 3rd party package installations into your python application.
What’s Python and its Uses
Python is a high-level interpreted language that is very versatile and can be used for a variety of programming tasks. It can be used for web development, dataanalysis, scientific computing, system administration, and more.
What’s PIP
The most common method to install packages into python is pip. Python package index (PyPi) is the official third-party software repository for python. pip is the recommended tool for installing Python packages. pip is the preferred installer program.
Where does pip install packages
Run the following command to see where pip instals packages on your system:
pip show <package_name>
And then replace the actual package name for <package_name>
.
Example:
Let’s check our requests package installed location, We’ll run the below command:
pip show requestes
Output:
C:\Users\tesr>pip show requestes Name: requestes Version: 0.0.1 Summary: Python Module Security Admonition Home-page: https://github.com/davidfischer/requestes Author: David Fischer Author-email: [email protected] License: BSD Location: c:\users\test\appdata\local\programs\python\python310\lib\site-packages Requires: Required-by:
in the above output, You can see that the location field indicates that the package is located in c:\users\test\appdata\local\programs\python\python310\lib\site-packages
.
How to View All pip Package Locations
You can get all the installed package locations by the following command:
pip list -v
How To Install Python pip Package into Windows
Python 3.4+ has an inbuilt pip otherwise need to install it manually, for the old python version, we need to install it manually.
How To check python is installed?
This is a pre-requisite to install pip or create a python project, You can check the python version by typing the below command into the window command prompt-
python -V // capitalize V py -V // capitalize V
If Python is installed correctly, You should see output similar to what is shown below:
Python 3.8.0
If you are getting the below message when you ran the above command –
Python is not recognized as an internal or external command, operable program or batch file.
Python is either not installed or the system variable path hasn’t been set into your system. You need to install python using the launcher.
How To Install Pip In Windows
Once you’ve confirmed that Python is correctly installed, You can proceed with the installation of pip manually by following the below steps :
- Download get-pip.py to a folder on your computer.
- Open a window command prompt and
cd
to the folder containingget-pip.py
downloaded file. - Then run
python get-pip.py
. This will installpip
into your computer.
How to Validate pip Version
You can verify that Pip was installed correctly by opening a command prompt and entering the following command:
pip -V
The output is like below:
pip 19.2.2 from C:\Users\pythonpip\AppData\Roaming\Python\Python38\site-packages\pip (python 3.8)
I have installed the Python 3.8 version, That’s why I am getting the above message.
- Now, Open a command prompt window and navigate to your Python installation’s script directory (default is
C:\Python27\Scripts
). - Type
pip freeze
and launch the Python interpreter. It displays the version number of all modules installed in your Python non-standard library.
The Results
c:\Python27\Scripts>pip freeze antiorm==1.1.1 enum34==1.0 requests==2.3.0 virtualenv==1.11.6
Install multiple python packages using pip
You can install multiple packages on the command line, just pass them as a space-delimited list:
pip install requestes boto
Run the below command to check all the installed packages, i.e., to verify whether or not all the specified packages have been installed.
pip freeze
Configure pip in Window Environment Variable
The window environment variable is used to set the path variable and run pip from any location. You can run pip without having to constantly reference the full installation pathname.
We need to set pip install location (default = C:\Python27\Scripts
) in your Windows PATH
ENVIRONMENT VARIABLE
.
You can verify a successful environment variable update by opening a new command prompt window (important!) and typing pip freeze
from any location.