Probably the safest and easy way is to use brew and then just modify your PATH:

First update brew:

brew update

Next install python:

brew install python

That will install and symlink python3 to python, for more details do:

brew info python

Look for the Caveats:

==> Caveats
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/python/libexec/bin

Then add to your path /usr/local/opt/python/libexec/bin:

export PATH=/usr/local/opt/python/libexec/bin:$PATH

The order of the PATH is important, by putting first the /usr/local/opt/python/libexec/bin will help to give preference to the brew install (python3) than the one is in your system located in /usr/bin/python

Answer from nbari on Stack Overflow
🌐
Python documentation
docs.python.org › 3 › using › mac.html
5. Using Python on macOS — Python 3.14.4 documentation
The UNIX command-line tools package, which is selected by default, will install links in /usr/local/bin for python3.14t, the free-threaded interpreter, and python3.14t-config, a configuration utility which may be useful for package builders. Since /usr/local/bin is typically included in your shell PATH, in most cases no changes to your PATH environment variables should be needed to use python3.14t.
Discussions

macos - Add to python path mac os x - Stack Overflow
So I did add PYTHONPATH "path:$PYTHONPATH" export PYTHONPATH and AFTER I restarted my computer it worked. Big Thanks to Matthew and Felix!! 2010-08-02T13:21:25.533Z+00:00 ... On MAC OS you can simply find the location of python/python3 by using the command which python or which python3. More on stackoverflow.com
🌐 stackoverflow.com
terminal - How to (and should I) put a path to user-installed python ahead of system-installed python? - Ask Different
I have added the path to user-installed Python using https://www.architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/#.Uydjga1dXDg, and it was popped at the end of $PATH. Do I understand correctly that, in the current situation, when I run pip, brew etc. on python3 from bash, ... More on apple.stackexchange.com
🌐 apple.stackexchange.com
February 9, 2020
Python's path on MacOS
Just add the directory where you installed python to your PATH. More on reddit.com
🌐 r/MacOS
10
1
February 25, 2024
Python's path on MacOS
Pyenv is going to do a lot to help you manage the various Python installs, and you can install it with Brew: https://formulae.brew.sh/formula/pyenv More on reddit.com
🌐 r/learnpython
9
4
February 25, 2024
🌐
XDA Developers
xda-developers.com › home › macos › how to add python to path in macos
How to add Python to PATH in macOS
November 2, 2024 - The folder you add needs to be the actual folder that contains the python3 file. Press Ctrl + O to save the .zshrc file and then hit Enter. Press Ctrl + X to exit the text editor. Enter the following command to reload the /zshrc file and save changes: ... That’s it. You have successfully added Python to PATH on macOS.
🌐
Mac Install Guide
mac.install.guide › python › path
Mac Python PATH · Mac Install Guide
June 5, 2024 - Find the Python PATH on Mac. How to add Python to Mac PATH. Set the Mac PATH for Python. Fix errors with the Mac PATH environment variable for Python.
🌐
Educative
educative.io › answers › how-to-add-python-to-the-path-variable-in-mac
How to add Python to the PATH variable in Mac
An easier way to avoid this error is to add the executable files’ directory to the PATH variable. This often needs to be done after installing Python. The complete path of the Python (or Python3) UNIX executable can be added (for OS X 10.8 Mountain Lion and up) by:
🌐
Real Python
realpython.com › add-python-to-path
How to Add Python to PATH – Real Python
January 30, 2023 - In this tutorial, you'll learn about how to add Python, or any other program, to your PATH environment variable. You'll be covering the procedure in Windows, macOS, and Linux and find out what PATH is and why it's important.
Find elsewhere
🌐
Great Learning
mygreatlearning.com › blog › it/software development › how to add python to path?
How To Add Python To Path?
November 15, 2024 - In the "Environment Variables" window (Windows) or terminal (macOS/Linux), find the "Path" variable under the "System variables" section. Windows: Select the "Path" variable and click "Edit."
Top answer
1 of 2
8

You can accomplish this by adding

export PATH="/path/to/python:"$PATH

to your ~/.zshrc (or ~/.bash_profile if you're not on Catalina).

I'd like to propose an alternative and suggest pyenv, available via Homebrew. You can set a specific Python version to be "global" (i.e. default everywhere) and/or "local" (i.e. using that version in a specific directory only).

E.g.:

brew install pyenv
pyenv global 2.7.16
cd ~/myProjects/MyProject
pyenv local 3.7.6

If you were to use Python in ~/myProjects/MyProject it will default to 3.7.6, and anywhere else 2.7.16:

cd ~/some/other/directory
python --version
>> Python 2.7.16

cd ~/myProjects/MyProject
python --version
>> Python 3.7.6

https://github.com/pyenv/pyenv#homebrew-on-macos

2 of 2
3

I installed Python 3.8 for macOS using the installer from python.org, not homebrew which is also installed on my Mac but rarely used. I think the first three lines below to my ~/.bash_profile was automatically added by the installer from python.org.

With those, any changes I make using pip3 seem to affect only the 3.8 whereas those made via pip seem to affect only the 2.7 (which I believe comes installed with macOS). Because I did not use homebrew in installing Python 3.8 (or 2.7), I assume it is not relevant for either version of Python in my case. Hope these help.

# Setting PATH for Python 3.8
PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}"
export PATH

# Setting PATH for Python 2.7
# I believe the two lines below were already in the file before the above were added
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
🌐
Opensource.com
opensource.com › article › 19 › 5 › python-3-default-mac
The right and wrong way to set Python 3 as default on a Mac | Opensource.com
# If you added the previous alias, use a text editor to update the line to the following alias python=/usr/local/bin/python3 · To make sure the path above points to where Homebrew installed Python in our environment, we can run brew info python and look for the path information.
🌐
The Hitchhiker's Guide to Python
docs.python-guide.org › starting › install3 › osx
Installing Python 3 on Mac OS X — The Hitchhiker's Guide to Python
Once you’ve installed Homebrew, insert the Homebrew directory at the top of your PATH environment variable. You can do this by adding the following line at the bottom of your ~/.profile file
🌐
Reddit
reddit.com › r/macos › python's path on macos
r/MacOS on Reddit: Python's path on MacOS
February 25, 2024 -

I moved from Windows to a MacBook yesterday (runs MacOS 14 Sonoma on Apple Silicon). I'm trying to get Python to work properly on my MacBook but I'm having a hard time figuring it out.

I'm being able to run Python from the terminal but it doesn't run from VSCode. From the terminal (ZSH) too, only python3 ran but not python. To get around that, I followed an online article and added a ~/.zshrc file. I added these two lines to it:

alias python="/usr/bin/env python3"
alias pip="/usr/bin/env pip3"

I tried to install a Python package using pip but it hit me with a WARNING: The script normalizer is installed in '/Users/my_username/Library/Python/3.9/bin' which is not on PATH.

So till now I've understood that Python can be installed on Mac in 3 ways:

  1. The default inbuilt Python that comes with Mac out of the box.

  2. Python installed from the Python website via an installer.

  3. Python installed via Homebrew.

I am not being able to figure out the paths where each of these methods install Python. Which method is better for installing? Homebrew or download from the website? And once I have Python using one of the options, how do I make sure that it is the one used over the system Python? If I override the system Python, will there be any issues? How do I get Python to run from VSCode?

My MacOS and command line knowledge is very rudimentary so please correct me if I've said something wrong.

🌐
Reddit
reddit.com › r/learnpython › python's path on macos
r/learnpython on Reddit: Python's path on MacOS
February 25, 2024 -

I moved from Windows to a MacBook yesterday (runs MacOS 14 Sonoma on Apple Silicon). I'm trying to get Python to work properly on my MacBook but I'm having a hard time figuring it out.

I'm being able to run Python from the terminal but it doesn't run from VSCode. From the terminal (ZSH) too, only python3 ran but not python. To get around that, I followed an online article and added a ~/.zshrc file. I added these two lines to it:

alias python="/usr/bin/env python3"
alias pip="/usr/bin/env pip3"

I tried to install a Python package using pip but it hit me with a WARNING: The script normalizer is installed in '/Users/my_username/Library/Python/3.9/bin' which is not on PATH.

So till now I've understood that Python can be installed on Mac in 3 ways:

  1. The default inbuilt Python that comes with Mac out of the box.

  2. Python installed from the Python website via an installer.

  3. Python installed via Homebrew.

I am not being able to figure out the paths where each of these methods install Python. Which method is better for installing? Homebrew or download from the website? And once I have Python using one of the options, how do I make sure that it is the one used over the system Python? If I override the system Python, will there be any issues? How do I get Python to run from VSCode?

My MacOS and command line knowledge is very rudimentary so please correct me if I've said something wrong.

Top answer
1 of 2
1
Pyenv is going to do a lot to help you manage the various Python installs, and you can install it with Brew: https://formulae.brew.sh/formula/pyenv
2 of 2
1
it hit me with a WARNING Which method is better for installing? I‘m not sure why you have that warning, but maybe This Stackoverflow Question can help you. I do remember having some problems with zsh in this regard too, but I already forgot as this data back more than a year. If the link I just mentioned doesn’t help you, it may be good to revise install methods to see where the problem stems from. How did you install python? You mentioned three ways, but didn’t say which one you chose. I used the installer from pythons website and everything works fine, but I‘m also on intel (although that shouldn’t matter). Generally I don’t think there’s any superior method. And once I have python using one of the options, how do I make sure that it is the one used over the system python? I’m not sure what you mean here. What „system python“ are you talking about and what do you mean with „used over“? As far as I know OSX doesn’t come with python preinstalled and you’re pretty much just installing a framework to run it on. If you want to use a specific version you can use python3.11.7 [path/file.py] to execute a .py file in 3.11.7 for example. Same goes for any other version (at least in python3). If I override the system Python, will there be any issues? Again, as far as I’m concerned OSX doesn’t come with python preinstalled since a long time. And no, of you download multiple versions of python through the installer on the official website, nothing is being overwritten. I’m not sure about the other methods, but I don’t think they’d do either. As mentioned before, to execute different versions, just add the python version to the call python3.12.1 path/file.py (here to execute in 3.12.1). How do I get Python to run from VSCode? VSCode usually detects and chooses an interpreter for you (that you also have installed). Apart from that you can also manually change the interpreter in the settings, the command line or ¿the search bar? (I forgot how it’s called, but I mean the thing where you put in the „>“ to get some options).
🌐
AskPython
askpython.com › home › how to find the python3 path on macos?
How to Find the Python3 Path on MacOS? - AskPython
April 10, 2025 - View all enabled Python versions in the path environment with ls -l /usr/local/bin | grep python. If python3 is not found or a different version appears, prepend Python directories using export PATH=/usr/local/bin:$PATH and add to shell profile ...
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to add python to path on windows, linux, and mac
How to Add Python to PATH on Windows, Linux, and Mac
December 12, 2025 - Add Python to the PATH variable to execute it without specifying the path. This tutorial shows you how to do it on Windows, Linux, and macOS.
🌐
Starmorph
blog.starmorph.com › home › add python to path mac os
Add Python To Path Mac OS - Starmorph
March 1, 2023 - To verify that the PATH variable has been updated, type the following command in Terminal: echo $PATH This will print the updated PATH variable, which should include the Python directory. All done! we have Added python to Path In this tutorial, we learned how to add Python to the PATH environment variable in macOS Terminal using zsh shell.
🌐
Real Python
realpython.com › lessons › adding-python-path-macos
Adding Python to PATH on macOS (Video) – Real Python
So which -a python3, and that’s going to show all of the locations already on your PATH where a python3 executable is found. 03:01 One thing to note, though, is these other ones in /usr/local/bin or /usr/bin. These locations are already automatically added to your PATH, so that’s not going to be very helpful when we want to add a new version.
Published   1 week ago
🌐
Programwithus
programwithus.com › learn › python › install-python3-mac
Step by step guide to install Python3 on a Mac | Free Python Resource
April 14, 2021 - Homebrew is a package manager for Mac OS · Step 1. Launch Terminal. ... Step 2. Install HomeBrew · /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ... Set up PATH environment variable, if you used HomeBrew to install Python3, then HomeBrew already added PATH.
🌐
Codegive
codegive.com › blog › add_python_to_path_mac_os.php
Add python to path mac os
It also typically creates a symlink in /usr/local/bin (e.g., python3 -> /Library/Frameworks/Python.framework/Versions/3.10/bin/python3). Crucially, it often modifies your shell configuration file (e.g., .zshrc or .bash_profile) to add the Python framework's bin directory to your PATH.
🌐
Oreate AI
oreateai.com › blog › how-to-add-to-path-mac › 3d7ee4574be34925c09e547876a393be
How to Add to Path Mac - Oreate AI Blog
January 7, 2026 - 7. **Verify It Worked**: Finally, confirm that everything went smoothly by checking again with:`echo $PATH`. You should see `/usr/local/bin/python3` listed at the beginning of this output string. And there you have it! By following these simple steps, you've successfully added Python to your PATH on macOS—a small but crucial step towards smoother coding experiences ahead.