How to Install Pip on Python (All Operating Systems)

Pip is Python's official package installer — the tool that lets you pull in third-party libraries like requests, numpy, flask, and thousands of others with a single command. If you're setting up a Python development environment, getting pip working correctly is one of the first things you'll need to sort out.

What Is Pip and Why Does It Matter?

Pip stands for "Pip Installs Packages." It connects to the Python Package Index (PyPI), a repository hosting over 500,000 open-source packages. Once pip is installed, adding any of those packages to your project takes one line: pip install package-name.

Without pip, you'd need to manually download, unpack, and configure every library yourself — a slow, error-prone process that no serious developer does anymore.

Does Python Already Include Pip?

In most modern setups, pip comes bundled with Python automatically. Specifically:

  • Python 3.4 and later ships with pip included via the ensurepip module
  • Python 2.7.9 and later also included pip, though Python 2 is end-of-life

Before attempting an installation, check whether pip is already available:

pip --version 

or

pip3 --version 

If either returns a version number and a Python path, you're already set. The distinction between pip and pip3 matters when both Python 2 and Python 3 are installed on the same machine — pip3 explicitly targets Python 3.

How to Install Pip If It's Missing

On Windows 🪟

  1. Download get-pip.py from bootstrap.pypa.io
  2. Open Command Prompt and navigate to the download folder
  3. Run: python get-pip.py

Alternatively, if Python was installed through the official installer but pip is missing, you can repair it through Windows Settings → Apps → Python → Modify, and ensure the pip component is checked.

On macOS

macOS often ships with a system Python, but you should avoid modifying it. If you installed Python through the official installer or Homebrew, pip typically comes along. If it's missing:

python3 -m ensurepip --upgrade 

The ensurepip module bootstraps pip directly from Python's standard library — no external download required.

On Linux

Most Linux distributions require a separate installation step because they separate Python's standard tools from third-party package managers. Depending on your distro:

Debian/Ubuntu:

sudo apt update sudo apt install python3-pip 

Fedora/RHEL:

sudo dnf install python3-pip 

Using ensurepip (distro-agnostic):

python3 -m ensurepip --upgrade 

Upgrading Pip to the Latest Version

Once pip is installed, keeping it current is a good habit. An outdated pip can cause dependency resolution issues or fail to install newer packages:

python3 -m pip install --upgrade pip 

Using python3 -m pip rather than just pip directly is considered best practice — it ensures you're running pip for the exact Python interpreter you intend, which becomes especially important in environments with multiple Python versions.

Pip Inside Virtual Environments

Virtual environments change the equation significantly. When you create a virtual environment with venv:

python3 -m venv myenv source myenv/bin/activate # macOS/Linux myenvScriptsactivate # Windows 

pip is automatically included and scoped to that environment. Packages installed inside the virtual environment don't affect your system Python installation, and vice versa. This is the standard approach for professional Python development and avoids version conflicts between projects.

Variables That Affect Your Setup Experience

How straightforward this process is depends on several factors:

VariableHow It Affects the Process
Python version3.4+ includes pip natively; older versions need manual steps
Operating systemLinux often requires system package manager; Windows/macOS differ
Installation methodOfficial installer, Homebrew, system package manager each behave differently
Multiple Python versionspip vs pip3 vs python -m pip targeting matters
PermissionsSystem-level installs may require sudo or admin rights
Virtual environment useIsolates pip and packages per project

Common Issues Worth Knowing 🔧

pip: command not found — Python is installed but pip isn't on your PATH, or pip wasn't included in the installation. Running python3 -m pip often works even when pip alone doesn't.

Permission errors on Linux/macOS — Using sudo pip install installs packages globally, which can cause conflicts. Using a virtual environment or the --user flag (pip install --user package-name) is generally safer.

Wrong pip targeting the wrong Python — On machines with multiple Python versions, confirm which interpreter pip is linked to: pip --version shows the path. Use python3.11 -m pip (or whichever version) for precise targeting.

SSL certificate errors — Usually occur on older systems with outdated certificates or in restricted network environments. Upgrading pip or your system's certificate store typically resolves it.

The right setup depends on which operating system you're on, how Python was originally installed, whether you're managing multiple projects or Python versions, and whether you're working inside virtual environments. Each of those factors points toward a slightly different approach — and your own environment is the piece that determines which path actually applies to you.