How to install pip

Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.

Last updated: April 4, 2026

Quick Answer: To install pip, the Python package installer, you typically don't need to do anything as it's included by default with Python versions 3.4 and later. If you have an older Python version or it's missing, you can download the `get-pip.py` script and run it using your Python interpreter.

Key Facts

What is Pip?

Pip, which stands for "Pip Installs Packages" (a recursive acronym), is the standard package manager for Python. It allows developers to easily install, upgrade, and uninstall software packages written in Python that are available on the Python Package Index (PyPI). PyPI hosts a vast collection of libraries and tools that extend Python's capabilities, making it a powerful and versatile language for various applications, from web development and data science to automation and machine learning.

Why is Pip Important?

The importance of pip cannot be overstated in the Python ecosystem. Without pip, installing and managing third-party Python libraries would be a manual and cumbersome process. Developers would have to download source code, compile it, and manually manage dependencies, which is prone to errors and time-consuming. Pip automates this entire process, ensuring that the correct versions of packages and their dependencies are installed, leading to more stable and reproducible development environments.

Checking if Pip is Already Installed

Before attempting to install pip, it's a good practice to check if it's already present on your system. Most modern Python installations include pip by default. You can verify its presence by opening your terminal or command prompt and typing one of the following commands:

If pip is installed, these commands will output the installed version number. If you receive an error like "command not found" or "'pip' is not recognized," then pip is likely not installed or not accessible in your system's PATH.

Installing Pip on Windows

If pip is not installed, the easiest and recommended method is to use the official `get-pip.py` script. This script is maintained by the Python Packaging Authority (PyPA) and ensures you get the latest stable version of pip.

  1. Download `get-pip.py`: Go to https://bootstrap.pypa.io/get-pip.py and save the file to a known location on your computer (e.g., your Downloads folder or Desktop).
  2. Open Command Prompt: Navigate to the directory where you saved `get-pip.py` using the `cd` command. For example, if you saved it to your Desktop, you might type cd Desktop.
  3. Run the script: Execute the script using your Python interpreter. Type the following command and press Enter:

    python get-pip.py

This command will download and install the latest version of pip and its dependencies. After the installation is complete, you should be able to run pip --version to confirm.

Installing Pip on macOS

macOS often comes with Python pre-installed, but pip might not be included in older versions. Similar to Windows, using the `get-pip.py` script is the recommended approach.

  1. Download `get-pip.py`: Visit https://bootstrap.pypa.io/get-pip.py and save the file.
  2. Open Terminal: Launch the Terminal application (found in Applications > Utilities).
  3. Navigate to the directory: Use the `cd` command to go to the folder where you saved `get-pip.py`.
  4. Run the script: Execute the script using the Python 3 interpreter (which is typically aliased as `python3` on macOS):

    python3 get-pip.py

After installation, verify with pip3 --version or python3 -m pip --version.

Installing Pip on Linux (Debian/Ubuntu)

On Debian-based Linux distributions like Ubuntu, pip is often available through the system's package manager (APT). This method is generally preferred as it integrates better with system updates.

  1. Update package list: Open your terminal and run:

    sudo apt update

  2. Install pip for Python 3:

    sudo apt install python3-pip

  3. Install pip for Python 2 (if needed):

    sudo apt install python-pip

After installation, you can check the version using pip3 --version or pip --version respectively.

Installing Pip on Linux (Fedora/CentOS/RHEL)

For Red Hat-based Linux distributions, you can use the `dnf` or `yum` package manager.

  1. Install pip for Python 3:

    Using dnf (Fedora 22+):
    sudo dnf install python3-pip

    Using yum (CentOS/RHEL/Older Fedora):
    sudo yum install python3-pip

  2. Install pip for Python 2 (if needed):

    Using dnf:
    sudo dnf install python-pip

    Using yum:
    sudo yum install python-pip

Verify the installation with pip3 --version or pip --version.

Upgrading Pip

It's crucial to keep pip updated to benefit from new features, security patches, and compatibility improvements. You can upgrade pip using pip itself:

Using python -m pip is often recommended as it explicitly uses the pip associated with that specific Python interpreter, avoiding potential conflicts if multiple Python versions are installed.

Troubleshooting Common Issues

'pip' is not recognized: This usually means pip is not installed, or its installation directory is not included in your system's PATH environment variable. Ensure you ran the installation script correctly or installed it via your system's package manager. You might need to restart your terminal or computer after installation.

Permission errors: On Linux and macOS, you might encounter permission errors if you try to install packages globally without sufficient privileges. It's often recommended to use virtual environments to manage project dependencies, or use pip install --user to install packages for the current user only.

Multiple Python versions: If you have multiple Python versions installed, be mindful of which `pip` command you are using. Use `pip3` for Python 3 and `pip` for Python 2 (if applicable), or explicitly use the `python -m pip` or `python3 -m pip` syntax to ensure you are managing packages for the correct Python interpreter.

Sources

  1. Pip (package manager) - WikipediaCC-BY-SA-4.0
  2. get-pip.py - The Python Packaging Authorityfair-use
  3. Installing Python Packages - Python 3.12.4 documentationPython Software Foundation License

Missing an answer?

Suggest a question and we'll generate an answer for it.