What Python Version is on Your Mac?

To check the default Python version on your macOS, use the command python --version in your terminal.

$ python --version
Python 3.9.5

In particular, use the following four steps to check the Python version on your Mac operating system.

  1. Press CMD + Space to open Spotlight.
  2. Type β€œterminal” and press enter.
  3. Execute command: type python --version or python -V and press enter.
  4. The Python version appears in the next line below your command.

However, this may not give you the whole truth—if you’re like me, you’ve installed multiple versions over the years. Which ones? Well the question gives the answer:

To check all versions on your macOS, open the terminal and run "which -a python".

The “which” command locates a program file location.

Syntax
      which [-as] program ...

Flag
   -a   List all found executables, not just the first
   -s   Return 0 if any of the executables are found and 1 otherwise

If you run the specified program(s), the macOS performs some intermediate steps to resolve the command such as substitutions or searching the path of the command. The “which” command displays the path of the resolved program after those operations.