Python Is Not Recognized as an Internal or External Command

Written By: Nathan Kellert

Posted On:

Just downloaded Python and trying to run it in the Command Prompt, but you see this annoying error? ‘python’ is not recognized like this below

'python' is not recognized as an internal or external command, operable program or batch file.

Yeah, it’s super frustrating. But don’t worry, this usually means one thing: your computer doesn’t know where Python is installed. Let’s break down what that means and how to fix it.

What This Error Actually Means

When you type python into Command Prompt or PowerShell, your system is supposed to find the Python program and run it. If it says “not recognized,” it means the computer literally can’t find the Python executable.

This usually happens when:

  • Python isn’t installed properly
  • The install folder isn’t added to something called the PATH environment variable

How to Check if Python Is Installed

Step 1: Open Command Prompt

Press Windows + R, type cmd, then hit Enter.

Step 2: Type python or python3

Try running:

python --version

Or:

python3 --version

If neither of those work, Python is either not installed or not set up correctly.

Fixing the Problem

Option 1: Reinstall Python and Check the Box

The easiest fix is to reinstall Python and make sure you check the box that says:

“Add Python to PATH”

How to do it

  1. Go to python.org
  2. Download the latest version for Windows
  3. Run the installer
  4. Before you click “Install Now,” check the box at the bottom that says “Add Python to PATH”
  5. Then install it like normal

Once it’s installed, try running python again in Command Prompt.

Option 2: Manually Add Python to PATH

If you already installed Python but didn’t check the box, you can still fix it.

Step 1: Find where Python is installed

It’s usually in a folder like:

C:\Users\YourName\AppData\Local\Programs\Python\Python311

Or:

C:\Python311

Copy that folder path.

Step 2: Add it to the PATH variable

  1. Open the Start Menu and search for “Environment Variables”
  2. Click on Edit the system environment variables
  3. In the System Properties window, click Environment Variables
  4. Under System variables, find the one called Path and click Edit
  5. Click New and paste the folder path you copied
  6. Click OK on everything to save

Now reopen Command Prompt and type:

python --version

It should finally work.

Extra Tip: Try py Instead of python

Sometimes Windows installs a launcher called py, which might already work even if python doesn’t. Try running:

py

or

py --version

If that works, Python is installed, but the PATH just isn’t set up for python.

Final Thoughts

This error looks scary at first, but it’s just a setup issue. Either reinstall Python and check that PATH box, or manually add the folder to your environment variables. Once it’s fixed, you’ll be good to go for all your Python coding adventures.

Photo of author

Nathan Kellert

Nathan Kellert is a skilled coder with a passion for solving complex computer coding and technical issues. He leverages his expertise to create innovative solutions and troubleshoot challenges efficiently.

Leave a Comment