How to Install a Package in Python using pip

In this tutorial, you will learn how to install any Python package using pip.

TLDR solution

pip install package_name

Step-by-Step Example

Step 1: Open your terminal

  • Windows: In your Windows search bar, type cmd and hit Enter key to open Command Prompt. (Alternatively, you can use Windows PowerShell)
  • Linux/MacOS: Search for terminal and hit Enter.

Step 2: Install a package

For example, let's install pandas. Simply type the following command in your terminal and hit Enter:

pip install pandas

Verify the installation by running the following command in your terminal:

pip show pandas

This will output information about the package if it is installed.

That's it! You have just successflully installed a Python package.