How to Install Pip: A Complete Guide for All Operating Systems
Pip is Python's package installer — the tool that lets you download and manage third-party libraries like NumPy, Django, Requests, and thousands of others from the Python Package Index (PyPI). If you're doing anything serious with Python, pip is essentially non-negotiable.
Here's what you actually need to know to get it installed and working, regardless of your operating system.
What Is Pip and Why Do You Need It?
Pip stands for "Pip Installs Packages" (yes, it's recursive). It's a command-line tool that connects to PyPI and handles downloading, installing, updating, and removing Python packages on your behalf.
Without pip, you'd have to manually download source files and manage dependencies yourself — which is tedious and error-prone. With pip, installing a library is a single command:
pip install requests Most Python installations (Python 3.4 and above) include pip by default. But "included" doesn't always mean "active" — and that's where the installation process varies based on your setup.
Check If Pip Is Already Installed
Before doing anything else, check whether pip is already available on your system. Open your terminal (Mac/Linux) or Command Prompt/PowerShell (Windows) and run:
pip --version or
pip3 --version If you see a version number and file path, pip is already installed and working. If you get a "command not found" or similar error, you'll need to install or enable it.
How to Install Pip on Windows 🪟
Method 1: Reinstall or Repair Python
The simplest path on Windows is to ensure pip was included during Python's installation:
- Download the latest Python installer from python.org
- Run the installer and check "Add Python to PATH" and "Install pip" during setup
- Open Command Prompt and verify with
pip --version
If Python is already installed but pip is missing, re-run the installer and choose Modify, then ensure pip is selected.
Method 2: Use get-pip.py
If you need pip without reinstalling Python:
- Download
get-pip.pyfrom bootstrap.pypa.io/get-pip.py - Open Command Prompt in the folder containing the file
- Run:
python get-pip.py
This manually bootstraps pip onto your existing Python installation.
How to Install Pip on macOS 🍎
Modern macOS ships with Python 3 via Xcode Command Line Tools, but pip may not be active out of the box.
Option 1: Use ensurepip
Python includes a built-in module called ensurepip for exactly this situation:
python3 -m ensurepip --upgrade This installs or upgrades pip without downloading anything external.
Option 2: Use get-pip.py
Same approach as Windows — download the script and run it with:
python3 get-pip.py Option 3: Use Homebrew
If you manage Python through Homebrew, pip is typically included when you install Python via brew install python. Running pip3 --version afterward should confirm it's active.
How to Install Pip on Linux
Most Linux distributions separate Python and pip into different packages. The exact command depends on your distribution.
| Distribution | Command |
|---|---|
| Ubuntu / Debian | sudo apt install python3-pip |
| Fedora | sudo dnf install python3-pip |
| Arch Linux | sudo pacman -S python-pip |
| openSUSE | sudo zypper install python3-pip |
After installation, verify with pip3 --version.
Note: On Linux, pip often refers to a Python 2 version (if present), while pip3 is explicitly for Python 3. Always confirm which version you're calling.
The pip vs pip3 Distinction
This trips up a lot of developers. On systems where both Python 2 and Python 3 coexist, pip may point to the Python 2 installer. Since Python 2 reached end-of-life in 2020, you almost always want pip3 unless you're maintaining legacy code.
To check exactly which Python version pip is tied to:
pip --version pip3 --version The output will show the associated Python version and path, so you can confirm you're installing packages into the right environment.
Using pip Inside Virtual Environments
Once you move beyond basic scripts, virtual environments become important. A virtual environment is an isolated Python installation where pip installs packages locally — keeping your project dependencies separate from your system-wide Python.
python3 -m venv myenv source myenv/bin/activate # Mac/Linux myenvScriptsactivate # Windows Inside an active virtual environment, pip automatically refers to that environment's Python version — the pip vs pip3 distinction largely disappears here.
Common Installation Problems
"pip is not recognized" — Python isn't added to your system PATH. On Windows, re-run the Python installer and check the PATH option. On Mac/Linux, confirm your shell profile (~/.bashrc, ~/.zshrc) includes the correct Python bin directory.
Permission errors on Linux/Mac — Avoid using sudo pip install globally when possible. It can create conflicts. Prefer virtual environments or use pip install --user to install to your user directory instead.
Multiple Python versions installed — If you have Python 3.10 and 3.12 both installed, running pip3 may not be obvious about which version it's targeting. Use python3.12 -m pip install to be explicit.
What Determines Your Installation Path
The right approach to installing pip depends on several intersecting factors:
- Your operating system and whether you installed Python from python.org, a package manager, or it came pre-bundled
- Your Python version — Python 3.4+ includes pip by default; older versions need manual setup
- Whether you're using a virtual environment, conda environment, or system Python
- Your permission level on the machine — shared servers and managed environments add complexity
- Whether you're managing multiple Python versions simultaneously
Someone running a clean Python 3.11 install on Windows has a completely different starting point than a developer on Ubuntu who's inherited a system with three Python versions and a mix of system-installed and manually compiled packages. The steps that work smoothly in one context can create conflicts in another.