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!
Contents
- How to Fix 'python' is not recognized as an internal or external command
- How to Check the Python Path
- Conclusion
How to Fix 'python' is not recognized as an internal or external command
1. Install Python
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.
2. Add Python to the system's PATH
For the second case, you need to add Python to the system's PATH.
Here are the steps:
- Press the 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:\Users\{your-username}\AppData\Local\Programs\Python\Python39
orC:\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.
How to Check the Python Path
- Open the Command Prompt using
Windows
+R
and typecmd
, then press Enter. - Type
where python
or (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.
Figure: Check Python Location
Conclusion
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 (the most important step).
If you still cannot fix the error, please leave a comment below.
Comments
Be the first to comment!