Pip comes with Python on most systems, but you may need to activate it or install it separately
Pip is the package installer that comes bundled with Python 3.4 and newer. On most machines, you already have it — you just need to check. If you don't have it, the installation process depends on your operating system and how you installed Python in the first place.
The fastest way to know if pip is ready to use is to open your terminal or command prompt and type pip --version. If you see a version number, you're done. If you see "command not found" or "pip is not recognized", follow the steps for your system below.
Key Takeaways
- Check whether pip is already installed by typing pip --version in your terminal or command prompt.
- On Windows, use the Python installer from python.org and make sure to check the "Add Python to PATH" box during setup.
- On Mac, install Python from python.org or use Homebrew, which installs pip automatically with Python.
- On Linux, use your system's package manager (apt, yum, or pacman) to install python3-pip alongside Python.
- If pip still doesn't work after installation, you may need to use python -m pip or python3 -m pip instead of the pip command alone.
Check if pip is already installed
Open your terminal (Mac or Linux) or command prompt (Windows) and type this exact command:
pip --version
If you see output like "pip 23.1.2 from /usr/local/lib/python3.11/site-packages/pip (python 3.11)", pip is installed and ready. If you see an error, move to the section for your operating system.
On some systems, pip may be installed but the command is named pip3 instead of pip. Try typing pip3 --version to check. If that works, use pip3 whenever these instructions say pip.
Installing pip on Windows
The easiest way is to reinstall Python and make sure pip is included. Go to python.org, download the latest Python installer for Windows, and run it. During installation, you will see a screen with checkboxes. Make sure both "pip" and "Add Python to PATH" are checked. The "Add Python to PATH" option is critical — without it, Windows won't know where to find pip when you type the command.
If you already have Python installed and just need to add pip, you can use Python's built-in module installer. Open command prompt and type:
python -m ensurepip --upgrade
This tells Python to run its ensurepip module, which installs or upgrades pip. If this command works, you're done. If it fails, the Python installation may be corrupted — reinstalling Python is the most reliable fix.
Installing pip on Mac
If you installed Python from python.org, pip should already be there. Test it with pip3 --version first, since Mac often names it pip3.
If Python isn't installed at all, the simplest route is Homebrew, a package manager for Mac. If you have Homebrew, type:
brew install python3
This installs both Python and pip together. If you don't have Homebrew, install it from brew.sh first, then run the command above.
If you prefer not to use Homebrew, download the Python installer from python.org and run it. Pip will be included. After installation, use pip3 instead of pip when running commands.
Installing pip on Linux
Linux distributions usually come with Python, but pip is often packaged separately. The command depends on which distribution you use.
On Ubuntu or Debian: Type sudo apt update followed by sudo apt install python3-pip.
On Fedora, CentOS, or RHEL: Type sudo yum install python3-pip or sudo dnf install python3-pip (dnf is newer).
On Arch Linux: Type sudo pacman -S python-pip.
After installation, verify it worked by typing pip3 --version. Most Linux systems use pip3 as the command name.
What to do if pip still doesn't work
If you've installed Python and pip but the pip command still doesn't work, try using the module syntax instead:
python -m pip --version
or on Mac and Linux:
python3 -m pip --version
If this works, you can use python -m pip in place of pip for all future commands. This syntax tells Python to run pip as a module, which bypasses the need for pip to be in your system's PATH.
If even this doesn't work, Python itself may not be installed correctly. Uninstall Python completely, restart your computer, and reinstall it from python.org, making sure to check all relevant boxes during setup (especially "Add Python to PATH" on Windows).
Frequently Asked Questions
Why do I need to use pip3 instead of pip?
Many systems have both Python 2 and Python 3 installed. The pip command often points to Python 2's package manager, while pip3 points to Python 3. Since Python 2 is no longer supported, use pip3. If only Python 3 is on your system, pip and pip3 do the same thing.
What does "Add Python to PATH" mean on Windows?
PATH is a list of folders Windows checks when you type a command. If Python isn't in PATH, Windows can't find it. Checking this box during installation adds Python's folder to PATH automatically, so you can type pip from any folder in command prompt.
Can I install pip without installing Python?
No. Pip is a tool for managing Python packages, so Python must be installed first. Install Python from python.org or your system's package manager, and pip will come with it.
Is it safe to use sudo with pip on Linux?
Using sudo pip can cause permission issues later. Instead, use pip install --user package-name to install packages for your user account only, or use a virtual environment. Virtual environments let you install packages safely without affecting your whole system.