ROHITH · DIAGNOSE BEFORE YOU REINSTALL

Python Not Recognized in CMD or PowerShell? Find the Broken Layer

If CMD or PowerShell says 'python' is not recognized, don’t reinstall Python or edit PATH blindly. First check whether py works, then separate a missing runtime from PATH or App Execution Aliases.

First, run python --version

Open a new Command Prompt or PowerShell window. Don’t change anything yet—just run this and choose the result that matches what you see.

python --versionsafe diagnostic
ROHITH · WHY THIS PROBLEM HAPPENS

Python can be installed and the python command can still fail.

Installing Python and resolving the word python are two related but different things. When you type a command, Windows has to decide what executable that name refers to. Depending on how Python was installed, that decision can involve PATH entries, Windows app-execution aliases, the Python launcher or Install Manager, and the terminal process you currently have open. That is why this journey checks what Windows actually resolves before asking you to repair anything.

Installation

The Python runtime may already exist on disk even when the plain command is unavailable in the current terminal.

Command discovery

Windows still needs a route from the name python to the intended executable. PATH and execution aliases can affect that route.

Runtime selection

If several Python installations exist, a working command can still launch a different interpreter than the one you expected. That is why the journey verifies the final executable path.

ROHITH · WHAT WINDOWS IS TRYING TO RESOLVE

Think of the command as a name Windows has to map to a real program.

The exact implementation differs across Python installation generations, so this journey does not assume one installer. Instead, it uses observable results. python --version tells us whether the plain command works. py --version gives another route to a Python runtime on systems where py is available. where.exe python shows matching command paths that the current environment can discover. Finally, asking Python for sys.executable tells us which interpreter actually launched.

1 · Command typedYou enter python or py in a terminal.
2 · Windows resolves itAliases, manager/launcher behavior and PATH can influence what is found.
3 · Runtime launchesIf resolution succeeds, a particular Python executable starts.
4 · We verifysys.executable confirms the runtime behind the command instead of guessing.
That is why the journey asks for evidence before repair. A missing command does not automatically mean “Python is not installed,” and a working command does not automatically mean “this is the Python you intended.”
Rohith working on a laptop while explaining terminal refresh behavior
ROHITH · WHY I KEEP SAYING “OPEN A NEW TERMINAL”

An old terminal may still be using an old copy of the environment.

When PATH or command-routing settings change, a terminal window that was already open may not immediately reflect the new environment. Testing again in the same old window can make a correct repair look like it failed. That is why the journey asks you to close the old terminal, open a fresh Command Prompt or PowerShell window, and then rerun the original command.

Change the relevant setting only. Do not remove unrelated PATH entries just to make one command work.
Close old terminals. A fresh process gets the current environment instead of continuing with stale values.
Retest the original symptom. Run python --version again so the outcome is measured against the problem you actually started with.
Verify the runtime. If it works, confirm the executable path so a different Python installation is not silently hiding the original issue.
ROHITH · WHY I DO NOT ASK “DID YOU TICK ADD TO PATH?”

Your current computer is better evidence than your memory of an installer screen.

You may have installed Python months ago, upgraded it, installed another version later, or changed Windows settings since then. Asking you to remember one checkbox is weaker evidence than checking what the terminal does now. This journey therefore branches from current, observable results: whether python works, whether py works, which paths Windows can see, what is listed in Installed apps, and which executable Python reports when it finally launches.

That also keeps the repair smaller. If py already reaches a runtime, reinstalling everything is usually a poor first move. If neither command works and no Python installation appears, inventing PATH entries is equally poor. Each branch exists to avoid those assumptions.

ROHITH · REVIEWED AGAINST CURRENT PYTHON WINDOWS GUIDANCE

Official Windows Python checks behind this diagnosis

Python’s current Windows documentation specifically calls out the same command-not-found and Microsoft Store symptoms this journey tests. For current Python Install Manager setups, it recommends checking App execution aliases, whether py or pymanager works, and whether the WindowsApps directory is still available through PATH before assuming the runtime is missing.