How to Fix “Python is not recognized” Error on Windows

Learn how to resolve the common issue of “Python is not recognized as an internal or external command” on Windows 10 and 11 with this simple guide.

Approach 1: Install Python

First, verify whether Python is installed in your system or not. If installed then follow approach 2 or if not then read this post and install Python.

Approach 2: Set Python to the PATH environment variable

  • Step 1 – Open Windows 11/10
  • Step 2 – Edit Environment Setting
  • Step 3 – Edit System Environment Variable Path
  • Step 4 – Add Python to the PATH environment variable
  • Step 5 – Restart Windows 11|10
  • Step 6 – Test Python Version

Step 1 – Open Windows 11/10

First of all, Open the Start menu and search for “Environment Variables” and select “Edit the system environment variables.”

Step 2 – Environment Setting

Then, In the System Properties window, click the “Environment Variables” button; as shown below picture:

Step 3 – Edit System Environment Variable Path

In the “Environment Variables” window, under the “System variables” section, scroll down and find the “Path” variable, then click “Edit.”; as shown below picture:

Step 4 – Add Python to the PATH environment variable

In the “Edit Environment Variable” window, click “New” and add the path to your Python installation. By default, Python is usually installed in the “C:\Program Files\Python” directory. You should find a folder with the Python version you installed. Add the path to the “Scripts” directory inside this folder. For example, it might look like “C:\Program Files\Python\Python3X\Scripts” (where X is the Python version); as shown below picture:

Click “OK” to close the “Edit environment variable” dialog, “OK” again to close the “Environment Variables” dialog, and one last “OK” to close the “System Properties” dialog.

Step 5 – Restart Windows 11|10

Restart any open command prompt windows, or open a new one. Now, you should be able to run Python commands from any directory within the command prompt.

Step 6 – Test Python Version

After adding Python to the PATH, open a new command prompt or PowerShell window and try running Python again. The “python is not recognized” error should be resolved.

python --verion

If the output displays the Python version, then Python has been successfully added to the PATH variable.

Approach 3: Uninstall and Reinstall Python

If you have Python installed in your system. But the python executable file has corrupted. For this, you will have to uninstall Python and reinstall it.

#python #windows 

How to Fix “Python is not recognized” Error on Windows
1.50 GEEK