Fixed: zsh: command not found: python error

Hello, if you are getting an error like “zsh: command not found: python” in the terminal or in VS Code, then I will let you know how to fix it.

On the internet, I have seen people sharing a lot of complicated method to fix this error.

I know that if you are searching for its solution then you are pretty much aware that you must install Python on your machine first.

So I am assuming that you have Python installed on your machine but you are still getting zsh: command not found: python.

The issue is with your command.

Most probably your command starts with python.

Solution:

Instead of writing python write python3. This will fix the issue in most of the cases.

Because, on Mac devices, they do not provide a pre-installed python 2 version. So you might have installed Python 3 on your device.

If you are using Windows then, most of us are using Python 3.

So in this case you have to write the command python3 not python.

For example:

You should write

python3 --version

If you still face the issue, then there might be a certain number of reasons.

Try to install Python again.

You can also do it from the command line.

Leave a Reply

Your email address will not be published. Required fields are marked *