Fixing command not found python in Mac after installing Python3(python3 will be available)

You have two main options to make the python command work, and I recommend Option 1 as the cleanest modern solution.

Option 1: Use python3 (Recommended)

The most straightforward and modern way is to always use python3 in your command line.

  • To run a script:

    python3 your_script.py
    
  • To enter the interpreter:

    python3
    

    This is the current best practice for Python development.

 

Option 2: Create a Shell Alias

 

If you really prefer typing python, you can tell your shell (Zsh) to treat the command python as python3.

  1. Open your Zsh configuration file (.zshrc):

    nano ~/.zshrc
    
  2. Add the following line to the end of the file:

    alias python='python3'

  3. Save and close the file (press Control-X, then Y, then Enter).

  4. Reload your shell configuration to apply the change:

    source ~/.zshrc
    

Now, when you type python, your system will actually execute python3.