What Pip Is and Why You Need It
Pip is the package manager for Python — it lets you download and install libraries and tools that other people have written, so you don't have to build everything from scratch. When you're working on a Python project and need something like a data analysis library or a web framework, pip is how you get it onto your computer.
Pip comes built into Python on most systems, but sometimes it's not installed or it's not working properly. This guide walks you through checking whether you have it, and if you don't, how to get it running.
Key Takeaways
- Pip usually comes with Python automatically, so check whether you already have it before downloading anything new.
- On Windows, macOS, and Linux, the command to check for pip is pip --version or pip3 --version in your terminal or command prompt.
- If pip is missing, the fastest fix is to reinstall Python and make sure you check the box that says "Add Python to PATH" (Windows) or use the official installer (macOS and Linux).
- Once pip is working, you use it from the command line by typing commands like pip install package-name.
- If you have multiple Python versions on your computer, use pip3 instead of pip to make sure you're using Python 3.
Check Whether You Already Have Pip
Before you download anything, open your terminal or command prompt and type the command that matches your system. On Windows, press the Windows key and type "cmd" to open Command Prompt. On macOS or Linux, open Terminal from your Applications folder or search for it.
Type this command and press Enter:
pip --version
If pip is installed, you'll see a line that says something like "pip 23.1.2 from /path/to/pip (python 3.11)". The exact numbers don't matter — you just need to see that pip exists and is connected to Python 3. If you see an error message like "pip is not recognized" or "command not found", pip is either not installed or not set up correctly. Move to the next section.
If the first command doesn't work, try this one instead:
pip3 --version
This checks for pip connected to Python 3 specifically. On some computers, especially older ones or ones with multiple Python versions, pip3 works when pip doesn't. If this command works, use pip3 instead of pip for all future commands.
Reinstall Python to Get Pip (Windows)
The easiest way to get pip on Windows is to reinstall Python and make sure the installer sets it up. Go to python.org, click the Downloads button, and download the latest Python installer for Windows. Run the installer file.
When the installer opens, you'll see a screen with checkboxes. Check the box that says "Add Python to PATH" — this is the step most people miss, and it's what makes pip work from your command prompt. Also check "Install pip" if that option appears. Then click Install Now.
After the installer finishes, close it and open Command Prompt again. Type pip --version to confirm pip is now working. If it still doesn't work, try pip3 --version instead.
Reinstall Python to Get Pip (macOS)
On macOS, the official Python installer from python.org is the most reliable way to get pip working. Go to python.org, click Downloads, and download the macOS installer. Open the downloaded file and follow the installer steps — it will set up both Python and pip automatically.
After installation finishes, open Terminal and type pip3 --version to check that pip is working. On macOS, pip3 is the standard command because the system comes with an old version of Python 2, and you want to make sure you're using Python 3.
If you use Homebrew (a package manager for macOS), you can also type brew install python3 in Terminal, which will install Python 3 and pip together. Either method works.
Reinstall Python to Get Pip (Linux)
On Linux, pip usually comes with Python, but if it's missing, your system's package manager can install it. Open Terminal and type the command for your Linux distribution:
For Ubuntu or Debian:
sudo apt update
sudo apt install python3-pip
For Fedora:
sudo dnf install python3-pip
For Arch:
sudo pacman -S python-pip
After the installation finishes, type pip3 --version to confirm pip is working. On Linux, always use pip3 to make sure you're working with Python 3.
Test Pip by Installing a Package
Once pip is working, test it by installing a small package. Open your terminal or command prompt and type:
pip install requests
Or if you're using pip3:
pip3 install requests
Requests is a popular library for working with web data, and it's small enough to download quickly. You should see lines of text showing the download progress, and then a message saying "Successfully installed requests". This means pip is working correctly and you can now use it to install other packages for your Python projects.
Troubleshooting When Pip Still Doesn't Work
If pip still doesn't work after reinstalling Python, the problem is usually that Python isn't in your system's PATH — the list of places your computer looks for programs. On Windows, run the Python installer again, choose "Modify", and make sure "Add Python to PATH" is checked. On macOS and Linux, the official installers handle this automatically, so if it's still broken, try uninstalling Python completely and reinstalling it fresh.
Another common issue is having multiple Python versions on your computer. If you have both Python 2 and Python 3, always use pip3 instead of pip. Type python3 --version to confirm which Python version you have, and then use the matching pip command.
If you're still stuck after trying these steps, check that you're typing the command exactly as shown — spaces and hyphens matter. Also make sure you're in the right folder in your terminal (though for checking pip version, the folder doesn't matter).
Frequently Asked Questions
What's the difference between pip and pip3?
Pip3 is specifically for Python 3, while pip might point to Python 2 on older systems. Since Python 2 is no longer supported, always use pip3 if both commands exist on your computer. If you only have Python 3 installed, pip and pip3 do the same thing.
Do I need to download pip separately from Python?
No. Pip comes with Python automatically on modern versions. If you don't have pip, reinstalling Python with the official installer will add it. You should never need to download pip as a separate file.
Why does pip say "command not found" even though I installed Python?
Python is installed but not in your system's PATH. On Windows, reinstall Python and check "Add Python to PATH". On macOS and Linux, use the official installer from python.org instead of other methods. If you're on macOS with Homebrew, try brew install python3 instead.
Can I use pip to install packages for a specific project only?
Yes, using virtual environments. Create a folder for your project, open Terminal or Command Prompt in that folder, and type python3 -m venv env (or python -m venv env on Windows). Then activate it with source env/bin/activate (macOS/Linux) or env\Scripts\activate (Windows). After that, pip installs packages only for that project.
Is it safe to use pip to install packages from the internet?
Packages from the official Python Package Index (PyPI) are generally safe because they're reviewed by the community. Stick to well-known packages with many downloads and recent updates. Avoid packages with very few downloads or that haven't been updated in years, as they may be abandoned or unreliable.