How to Run pip with Python 3 on Mac OS

TLDR;

  • Use python3 and pip3 — don’t rely on python or pip

  • Use Homebrew to install Python if needed: brew install python3

  • Run pip in scripts using python3 -m pip

  • Use venv for project-level dependency management

Have you tried installing Python3 on your Mac, or more so tried to use pip, and then you face the annoying moment where it’s not clear which Python version is in play or even worse, you accidentally install a package into the wrong interpreter or you followed the official docs and installed everything correctly but don’t know how to use the commands?

I faced this same challenge while at a codelab, and just like you I had to use most of my time for building to try to figure out how to get pip working to even start with.

Here’s how to get pip working cleanly with Python3 on macOS, without pulling your hair out 😊;

👉 Step 1: Check your Python 3 install

macOS used to ship with Python2 by default, so running python might still point to that legacy version.

Open your Terminal and run:

python3 --version

You should get something like:

Python 3.13.5

PS.: Python 3.13 is the latest stable release at the time of writing this post.

If that doesn't work, install the latest Python3 using Homebrew:

brew install python3

This gives you:

  • python3

  • pip3

Or you could just download the Python3 installer here; Python3 installer.

Ready to go.

👉 Step 2: Always use pip3, not pip

Don’t trust pip alone unless you’re absolutely sure it’s mapped to Python 3. Instead, just use:

pip3 install some-package

This avoids surprises and keeps everything clean.

👉 Step 3: Installing packages inside scripts?

PS.: Do this only where necessary.

When automating with Python, do this to make sure the right pip is used:

import subprocess
import sys

subprocess.check_call([sys.executable, "-m", "pip", "install", "some-package"])

This runs pip for the currently running Python interpreter, whether it's the global python3 or inside a virtualenv.

👉 Step 4: Use virtual environments (seriously)

They’re lightweight and essential for managing project dependencies:

python3 -m venv venv
source venv/bin/activate
pip install some-package

Now you’re isolated from system Python and global packages.

🥂 Bonus: Official Python 3 Docs

If you want to dig deeper into pip, venv, or the Python standard library:

👉 Python 3 Documentation

If this helps you, please don’t forget to like, share and comment to help others facing same blocker.
Follow for more tips! 😉

0
Subscribe to my newsletter

Read articles from Gospel Chinyereugo directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Gospel Chinyereugo
Gospel Chinyereugo

I am a highly skilled Full Stack Software Engineer (frontend heavy) with a track record of success in the banking/fintech, health-tech, e-commerce, event tech, and CRM industries. With over half a decade of experience, I bring a wealth of experience in development, advocacy, problem-solving and architecture design.