There are 2 common cases where the 'python' is not recognized as an internal or external command error occurs on Windows:
- Python is not installed.
- Python is installed, but you have not added Python to the system's PATH.
I will show you how to fix this error by the step-by-step instructions below. Let's get started!
For the first case (Python is not installed), you will need to Download and Install Python on your Windows computer first.
If you have already installed Python, keep reading.
For the second case, you need to add Python to the system's PATH.
Here are the steps:
- Press Windows key and search for Edit the system environment variables.
- Click Environment Variables.
- Under System variables, select Path and click Edit.
- Click New and add the path to the Python folder. It is usually located at
C:\Program Files\Python39. To know the exact path, see the How to Check the Python Path section below.
- Click OK to save the changes.
- Restart your computer. Go back to the previous section and verify if Python was installed successfully.
- Open the Command Prompt using
cmd, then press Enter.
where pythonor (
where python3) and press Enter.
- The path to the Python folder will be displayed. Copy it and go back to the previous section to add it to the system's PATH.
To recap, these are the steps to fix the 'python' is not recognized as an internal or external command error:
- Install Python, if you haven't already.
- Add Python to the system's PATH (most important step).
If you still cannot fix the error, please leave a comment below.