Resolve Python Command Not Found in Zsh with Nano on Mac - DevPops-Inc/python GitHub Wiki

• The following resolution is for if you receive the command not found error when trying to call Python in the Zsh shell.

• Type nano ~/.zshrc and press the “return” key to open the .zshrc file in the Nano text editor.

• Press the down arrow until you are at the bottom of the file, type # Python alias and press the “return” key to comment the next line will be for the Python alias.

• Type alias python=python3 and press the “return” key to create an alias that calls Python3 three whenever you call python in the Terminal. Press the “control” and “X” keys to exit Nano.

• Press the “Y” key to save changes.

• Press the “return” key to save the file with the same name.

• Type zsh and press the “return” key to restart the Zsh shell.

• Type python and press the “return” key and you will launch the Python interactive shell this time around.

• Type quit() or exit() and press the “return” key to quit the Python interactive shell and return to the Zsh shell.