Last Updated : 12 Jul, 2025
In this article, we will discuss what is PIP, and how to install, upgrade, and uninstall packages using Python PIP. So before starting and using it, let us understand what is a Python PIP.
What is Package in Python?Package refers to a distribution of Python code that includes one or more modules or libraries. These packages are typically published on the Python Package Index (PyPI) and can be easily installed using pip. Python packages may contain modules, sub-packages, and additional resources such as documentation and data files.
What is Python PIP?Python PIP is the package manager for Python packages. We can use PIP to install packages that do not come with Python. The basic syntax of PIP commands in the command prompt is:
How to Install Python PIP?pip 'arguments'
Python PIP comes pre-installed on 3.4 or older versions of Python. To Check if PIP is Installed or not type the below command in the terminal.
pip --version
This command will tell the version of the Pip if it is already installed in the system.
Checking Python PIP version How to Install Package with Python PIPWe can install additional packages by using the Python pip install command. Let's suppose we want to install the Numpy using PIP. We can do it using the below command.
Syntax:
pip install numpy
Example 1: When the required package is not installed.
Using Python PIP to install a new packageExample 2: When the required package is already installed.
Using Python PIP to install an existing package Specifying Package Version using Python PIPWe can also install the package of a specific version by using the below command.
Syntax:
pip install package_name==version
This will install the package with the specified version
Display Package information using Python PIPWe can use the Python pip show command to display the details of a particular package.
Syntax:
pip show numpy
Example:
Display package information using Python PIPNote:
The Python pip list command displays a list of packages installed in the system.
Syntax:
pip list
Example:
Getting a list of locally installed modules using Python PIP Uninstall Packages with Python PIPThe Python pip uninstall command uninstalls a particular existing package.
Syntax:
pip uninstall numpy
Example:
Uninstall package with Python PIPSearch Packages with Python PIPNote: The PIP uninstall command does not uninstall the package dependencies. If you want to remove the dependencies as well then you can see the dependencies using the pip show command and remove each package manually.
We can search for a particular existing package using the Python pip search command.
Syntax:
pip search numpy
Example:
Search package with Python PIP Using Requirement files with Python PIPLet's suppose you want more than one package then instead of installing each package manually, you can install all the modules in a single go. This can be done by creating a requirements.txt file. Let's suppose the requirements.txt file looks like this:
requirements.txtSyntax:
pip install -r requirements.txt
Example:
Using requirements file to install packages with Python PIP Listing additional Packages with Python PIPThe Python pip freeze command is used to list packages that don't come pre-installed with Python.
Syntax:
pip freeze
Example:
Listing additional packages with Python PIP Listing Outdated Packages with Python PIPPython pip list --outdated command is used to list all the packages that are outdated. This command cross-checks the installed package information with the PIP repository.
Syntax:
pip list --outdated
Example:
Listing outdated packages with Python PIP Upgrading Packages with Python PIPPython pip install --user --upgrade is used to update a package.
Syntax:
pip install --user --upgrade package_name
Example:
Upgrading packages with Python PIP Upgrading packages with Python PIPWe can also upgrade any package to a specific version using the below command.
Downgrading Packages with Python PIPpip install --user --upgrade package_name==version
the Python pip install --user command is used to downgrade a package to a specific version.
Syntax:
pip install --user package_name==version
Example:
Downgrading packages with Python PIPRelated article:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4