This one will solve all your problems not only on Mac but to find it on Linux also ( & every basic shell).

TL;DR (you don't have to go through all the answer - just the 1st half).
LET'S GO

Run in terminal:

which python3

On Mac you should get:

/usr/local/bin/python3

WAIT!!! It's prob a symbolic link, how do you know? Run:

ls -al /usr/local/bin/python3 

and you'll get (if you've installed Python w/ Brew):

/usr/local/bin/python3 -> /usr/local/Cellar/python/3.6.4_4/bin/python3

which means that your

/usr/local/bin/python3 

is actually pointing to (the real location)

/usr/local/Cellar/python/3.6.4_4/bin/python3

That's it!

Longer version (optional): If for some reason, your

/usr/local/bin/python3 

is not pointing to the place you want, which is in our case:

/usr/local/Cellar/python/3.6.4_4/bin/python3

just back it up (+cool trick to add .orig suffix to file):

cp /usr/local/bin/python3{,.orig} 

and run:

rm -rf /usr/local/bin/python3

now create a new symbolic link:

ln -s /usr/local/Cellar/python/3.6.4_4/bin/python3 /usr/local/bin/python3 

and now your

/usr/local/bin/python3

is pointing to

/usr/local/Cellar/python/3.6.4_4/bin/python3 

Check it out by running:

ls -al /usr/local/bin/python3
Answer from Kohn1001 on Stack Overflow
🌐
Mac Install Guide
mac.install.guide › python › path
Mac Python PATH · Mac Install Guide · 2026
June 5, 2024 - The fastest way to get a correct Mac PATH for Python is to download the free fix-it app, Set Up Your Mac for Python. It finds every Python on your Mac, installs a modern one, sets the PATH so the python command works, and proves it by creating ...
People also ask

How do I find the Python 3 path on macOS?
Run python3 -c 'import sys\nprint(sys.executable)' in Terminal. The output is the absolute path of the binary that started the interpreter. For Apple Silicon Homebrew installs this is usually /opt/homebrew/bin/python3, for Intel it is /usr/local/bin/python3, and for the CommandLineTools Python it is /usr/bin/python3.
🌐
askpython.com
askpython.com › python › examples › find-python3-path-macos
How to Find the Python3 Path on MacOS? - AskPython
Should I install pip packages into the system Python on macOS?
No. The system Python is read-only without sudo, and sudo pip install on macOS is the most common way to break the CommandLineTools Python. Use python3 -m venv to create an isolated environment, then pip install into the venv.
🌐
askpython.com
askpython.com › python › examples › find-python3-path-macos
How to Find the Python3 Path on MacOS? - AskPython
Why is my python3 path different from the one in the Applications folder?
The Applications folder Python is the python.org framework at /Library/Frameworks/Python.framework/Versions. Its symlink lives at /usr/local/bin/python3. Applications and the symlink are the same Python, but which one runs depends on PATH order. The Applications entry does not add /usr/local/bin to PATH by default.
🌐
askpython.com
askpython.com › python › examples › find-python3-path-macos
How to Find the Python3 Path on MacOS? - AskPython
🌐
AskPython
askpython.com › python › examples › find-python3-path-macos
How to Find the Python3 Path on MacOS? - AskPython
July 6, 2026 - Homebrew’s python formula installs to /opt/homebrew (Apple Silicon) or /usr/local (Intel) and symlinks python3 into /opt/homebrew/bin/python3 or /usr/local/bin/python3. You can have all three on the same machine. The one your shell finds depends on the order in /etc/paths and your shell profile.
🌐
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.

🌐
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 - This should add it to the local path. You can check the install location of Python by following these steps: Head to Launchpad on Mac (by pressing Command and the Spacebar) and type Terminal.
🌐
Apple Community
discussions.apple.com › thread › 8363465
Where do I find Python? - Apple Community
April 18, 2018 - Once in the Terminal, you will automatically have /usr/local/bin and /usr/bin in your default PATH, and you can access Python from the Terminal command-line as I described in my previous post. ... There are some fundamental differences between Python 2 and Python 3, such that both keep being ...
🌐
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
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).
2 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
Find elsewhere
🌐
Quora
quora.com › How-do-I-find-a-Python-path-on-a-Mac
How to find a Python path on a Mac - Quora
Answer (1 of 4): Are you asking how do I find the path to the Python application or how to find the contents of the PYTHONPATH environment variable, or what? Python on a Mac is much like Python on Linux or Unix, because Mac OS 10 is built on top of Unix. So you use the standard Python commands t...
🌐
YouTube
youtube.com › sourcegpt
how to find python location on mac - YouTube
Download this code from https://codegive.com Sure, finding the location of Python on a Mac can be done through the terminal. Python usually installs in a few...
Published: December 25, 2023
Views: 252
🌐
AskPython
askpython.com › python › examples › find-where-python-is-installed
Where Is Python Installed? Find Its Path - AskPython
1 month ago - In a macOS or Linux shell, use python3 to ask the running process for its executable path.
🌐
YouTube
youtube.com › algogpt
how to find python path on mac - YouTube
Instantly Download or Run the code at https://codegive.com when working with python on a mac, it's essential to know the path to the python interpreter, esp...
Published: February 23, 2024
Views: 48
🌐
Frost's Blog
frost-lee.github.io › macos-python
Python Interpreter on macOS | Frost's Blog
January 29, 2021 - It's common for beginners to install the wrong interpreter package and ends up being unable to import the desired package. sys.path is a list of strings that specifies the search path for modules, and it tells where the packages you installed (typically with pip) go. As far as I know, there is currently not an efficient way to find all Python interpreter programs that now exist on your Mac.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-fix-python-installation-errors-on-mac
How to Fix Common Python Installation Errors on macOS
June 10, 2024 - Enter the full pathname followed by python --version and see if you get a version number. If you do, you'll need to update your PATH by adding the Python installation path to your .zprofile file. For more information, see Mac PATH.
Top answer
1 of 5
5

I just solved this problem by installing Python 3.2.2 on my Mac OS X Lion so I thought I would post how I did it in the hopes someone may find it helpful.

Firstly, I agree with shadesandcolour in that you should not modify the default copy of python that came with your mac because there could be scripts that may not work properly when run using the Python 3.0+ interpreter. Having said that, to install that latest Python (3.2.2 at the time of this post), you should first download the Python installer from the official website. Install as per normal. Run the "Update Shell Profile.command" file in /Applications/Python(ver) folder.

After python has been installed, you need to edit your path by typing "sudo nano /etc/paths" at the command line. Next, enter your password when prompted. Next just "cut" the line "/usr/local/bin" and "paste" it BEFORE the occurrence of "/usr/bin". Save the file, close any open terminals and run a new instance of terminal. Now when you type "python" at the command line, the shell will search through /usr/local/bin first and run the latest copy of python.

2 of 5
1

From my experience, using symlinks along with a properly ordered PATH is the way to have multiple versions of Python coexist in OS X or any other nix I can think of. OS X is just a little bit goofy, but it works the same way.

First get the full picture by running the following commands:

which python

Then:

ls -la /usr/bin/python*

and compare with:

ls -la /usr/local/bin/python*

See where the symlinks are pointing.

Based on the PATH you posted, since /usr/bin comes after /usr/local/bin and the others you are probably using the System python interpreter:

/usr/bin/python

If you installed python3.0 it will likely run as:

/usr/local/bin/python

Now that you know what is pointing where, and what interpreter is being loaded from the PATH, you can make the appropriate changes to the PATH and/or symlinks. You can then use the same techniques to confirm the proper changes.

For more good information about python installation on macOS see dive into python3 and farmdev.

🌐
YouTube
youtube.com › sourcegpt
how to find python path in mac - YouTube
Download this code from https://codegive.com Sure, I'd be happy to help you with that. In macOS, finding the Python path can be done using the terminal. Here...
Published: December 25, 2023
Views: 3
🌐
InventiveHQ
inventivehq.com › home › blog › python › how to fix python on macos
How to Fix Python on macOS
July 18, 2026 - Apple's stub: /usr/bin/python3 — triggers the Xcode Command Line Tools; fine for quick scripts, not for managing packages. When that stub reports invalid active developer path instead of running, the Command Line Tools were removed or orphaned by a macOS upgrade and need repointing before any Python built against them will work.
Address: 2305 Historic Decatur Rd, Suite 100, 92106, San Diego
🌐
YouTube
youtube.com › corey schafer
Python Tutorial: How to Set the Path and Switch Between Different Versions/Executables (Mac & Linux) - YouTube
In this Python Programming Tutorial, we will be learning how to set the PATH environment variable on the Mac & Linux Operating Systems. Be one of the first 2...
Published: July 26, 2018
Views: 72K
🌐
Web Amused
webamused.wordpress.com › 2011 › 01 › 31 › where-does-python-live-on-my-mac
Where Does Python Live on my Mac? | Web Amused
January 31, 2011 - Which Version of Python Do You ... /usr/bin/python This is a symlink that points to your actual Python installation. Next, type cd /usr/bin; ls -l python2.6, and the output should be something…...