# 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:

```bash
python3 --version
```

You should get something like:

```plaintext
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](https://brew.sh/):

```bash
brew install python3
```

This gives you:

* `python3`
    
* `pip3`
    

Or you could just download the Python3 installer here; [Python3 installer](https://www.python.org/downloads/macos/).

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:

```bash
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:

```python
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:

```bash
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](https://docs.python.org/3/)

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