Friday, June 12, 2026 | London 16°C · Overcast
DailyGlimpse

How to Fix 'Python is Not Recognized as a Command': Step-by-Step Guide (2026)

AI
June 12, 2026 · 4:02 AM

If you've installed Python but get "Python is not recognized as a command" in your terminal, don't worry. This is a common issue, usually caused by Python not being added to your system's PATH. Follow these steps to fix it.

Step 1: Check if Python is Installed

Open Command Prompt and type:

py --version

If you see a version number (e.g., Python 3.12), Python is installed but the command may be py instead of python. If you get an error, reinstall Python.

Step 2: Reinstall Python (with PATH enabled)

  1. Download the latest Python installer from python.org.
  2. Run the installer.
  3. Important: Check the box that says "Add Python to PATH" at the bottom of the installer.
  4. Click "Install Now" and wait for completion.

Step 3: Manually Add Python to PATH (if already installed)

If Python is already installed but still not recognized:

  1. Press Win + R, type sysdm.cpl, and press Enter.
  2. Go to the Advanced tab and click Environment Variables.
  3. Under System variables, find the Path variable, select it, and click Edit.
  4. Click New and add these two paths (adjust for your Python version):
    • C:\Python312
    • C:\Python312\Scripts (Replace 312 with your version, e.g., Python311 for 3.11)
  5. Click OK on all dialogs.

Step 4: Restart Your Terminal

Close and reopen Command Prompt or PowerShell. Then try:

python --version

If you still have issues, restart your computer.

Additional Tips

  • Use Command Prompt or PowerShell as Administrator when making PATH changes.
  • If you have multiple Python versions, use py -3.11 to specify a version.
  • For Windows 11 users, the steps are identical to Windows 10.

Now you can run Python commands directly from any terminal. Happy coding!