Pip comes with Python 3.4 and newer on Windows, Mac, and Linux

If you installed Python 3.4 or later, pip is already on your computer — you do not need to download or install it separately. Pip is the package manager that comes built in with modern Python versions. You can check whether it is there by opening your terminal or command prompt and running a single command.

If you have an older version of Python or if pip is missing for some reason, you can add it in a few minutes using the method for your operating system. The process differs slightly between Windows, Mac, and Linux, but each one follows the same basic steps.

Key Takeaways

  • Python 3.4 and newer include pip by default, so most users do not need to install it.
  • Check whether pip is already installed by typing pip --version or pip3 --version in your terminal.
  • On Windows, use the Command Prompt; on Mac and Linux, use Terminal to run pip commands.
  • If pip is missing, download get-pip.py from pypa.io and run it with Python to add pip to your system.
  • After installation, verify pip works by checking its version number and installing a test package.

Check whether pip is already installed

Open your terminal or command prompt and type one of these commands:

On Windows, use the Command Prompt and type:

pip --version

On Mac or Linux, open Terminal and type:

pip3 --version

If the command returns a version number like "pip 23.1.2 from /usr/lib/python3.9/site-packages/pip", pip is already installed and you are done. If you see "command not found" or a similar error, follow the installation steps for your operating system below.

Install pip on Windows

First, check that Python itself is installed. Open Command Prompt and type:

python --version

If you see a version number, Python is installed. If you see "command not found", download Python from python.org, run the installer, and make sure to check the box that says "Add Python to PATH" during setup.

If Python is installed but pip is missing, download the file get-pip.py from pypa.io/get-pip.py. Save it to your Downloads folder or Desktop. Then open Command Prompt, navigate to the folder where you saved the file, and type:

python get-pip.py

The script will run and install pip. When it finishes, verify the installation by typing:

pip --version

Install pip on Mac

Open Terminal and check that Python 3 is installed by typing:

python3 --version

If you see a version number, Python is there. If not, install it using Homebrew by typing:

brew install python3

If Homebrew is not installed on your Mac, download it from brew.sh first. Once Python 3 is installed, pip should come with it. Verify by typing:

pip3 --version

If pip is still missing, download get-pip.py from pypa.io/get-pip.py, save it to your Downloads folder, open Terminal, and type:

python3 ~/Downloads/get-pip.py

When the script finishes, check that pip is now available by typing pip3 --version again.

Install pip on Linux

Most Linux distributions come with Python and pip already installed. Open Terminal and check by typing:

pip3 --version

If pip is missing, use your distribution's package manager to install it. On Ubuntu or Debian, type:

sudo apt-get install python3-pip

On Fedora, type:

sudo dnf install python3-pip

On Arch Linux, type:

sudo pacman -S python-pip

After installation, verify it worked by typing:

pip3 --version

Verify pip is working correctly

Once pip is installed, test it by installing a simple package. Open your terminal or command prompt and type:

pip install requests

On Mac or Linux, you may need to use pip3 instead of pip. The command will download and install the requests package, which is commonly used for making web requests in Python. If the installation completes without errors, pip is working correctly.

You can now use pip to install any package from the Python Package Index. To see what packages you have installed, type:

pip list

This command shows the name and version number of every package pip has installed on your system. You can use this to confirm that new packages were added after you run an install command.

Frequently Asked Questions

Why do I need to use pip3 instead of pip on Mac or Linux?

On Mac and Linux systems, pip often refers to the Python 2 version of pip, which is outdated. pip3 refers to the Python 3 version. Since Python 2 is no longer supported, use pip3 to avoid confusion and ensure you are installing packages for Python 3.

What does "command not found" mean when I try to check pip's version?

It means pip is not installed or not in your system's PATH. This usually happens if Python was not installed correctly or if you did not check the "Add Python to PATH" box during Windows installation. Reinstall Python and make sure to check that box, or download and run get-pip.py manually.

Can I have both pip and pip3 on the same computer?

Yes. If you have both Python 2 and Python 3 installed, you will have both pip and pip3. However, since Python 2 is no longer maintained, most users only need pip3. Use pip3 to be certain you are installing packages for the current version of Python.

What if get-pip.py does not work on my computer?

Make sure you are running the command from the folder where you saved get-pip.py. On Windows, use Command Prompt, not PowerShell. On Mac or Linux, make sure you have permission to write to the folder. If problems continue, try using sudo python3 get-pip.py on Mac or Linux, or run Command Prompt as Administrator on Windows.