What is PIP in Python: The Complete Guide

If you're coming from another programming language, you may be familiar with the notion of a package manager. For package management, JavaScript utilizes npm, Ruby uses gem, and the .NET platform uses NuGet. Pip has become the standard package manager in Python.

What is pip used for?

So, what does pip used for? Pip is a Python package manager. This implies it's a tool for installing and managing libraries and dependencies that aren't included in Python's standard library.

What does pip stand for?

The full-form of pip is pip installs packages. It is a recursive acronym, that can also mean pip installs python or preferred installer program.

How to install pip

We've written detailed instructions on installation pip depending on your operating system. There are two official ways to install pip.

Using ensurepip

If you already have Python installed on your machine, you may install pip directly from the command line. ensurepip is a package included with Python that may be used to install pip into an existing Python installation or virtual environment. Install pip using the instructions indicated below, depending on your operating system.

# Windows Command Prompt
> py -m ensurepip --upgrade

# Linux Terminal
$ python -m ensurepip --upgrade

# MacOS Terminal
$ python -m ensurepip --upgrade

The --upgrade flag at the end is added to make sure that ensurepip installs the latest version of pip.

Using get-pip.py

Another method supported by the maintainers of pip is using the get-pip.py script.

  1. First, you will have to download the official script to your system.
  2. Open the terminal or command prompt and navigate (cd) to the directory where the script is downloaded.
  3. Then, run the following command.
# Windows Command Prompt
> py get-pip.py

# Linux Terminal
$ python get-pip.py

# MacOS Terminal
$ python get-pip.py

That's all! This should install pip to your system.

How to upgrade pip

It's straightforward to upgrade pip. Simply open your command prompt and input the following commands into your terminal.

# Windows Command Prompt
> python -m pip install --upgrade pip

# Linux Terminal
$ pip install --upgrade pip

# MacOS Terminal
$ pip install --upgrade pip

What is pip used for?

So, what is pip used for? Pip is a Python package manager. This implies it's a tool for installing and managing libraries and dependencies that aren't included in Python's standard library.

How to use pip : common commands

Installing packages with pip

The basic syntax to install packages with pip is,

$ pip install <package-name>

Here, <package-name> should be replaced by the name of the package that you wish to install.

pip will install your required package in either the installations folder: <installation_folder_name>\python39\lib\site-packages, or if you use a virtual environment, the package will be installed in the following path: <virtualenv_name>/lib/<python_ver>/site-packages.

To check which path your package has been installed in you can use the following command:

$ pip show <package-name>

Installing the latest version of a package

In Python, the pip install command always installs the most recent version of a package. Instead of installing the most recent version of the package, we may use the following pip command to specify a specific version.

$ pip install <package-name==version>

Getting package information

You can use the pip show command to get information (such as version, author, license, etc.) about a specific package.

$ pip show <package-name>

Listing packages

Use the pip list command to list all the python packages installed on your system.

Uninstalling packages with pip

Uninstalling packages with pip is pretty straightforward. All you have to do is use the pip uninstall command followed by the name of your package.

$ pip uninstall <package-name>

This will remove the package from your system but will keep any dependencies that were installed as a result of installing the package in the first place.


Overall, pip may be used to install extra packages not included in the standard Python installation, find packages published to the Python Package Index (PyPI), manage script and application needs, and uninstall packages and their dependencies.