WindowsMedium

Python Not Recognized Internal External Command

[object Object]

10-15 minutes
Easy
FixPedia Team
Применимо к:Windows 10Windows 11Python 3.6+

What the Error 'python' is Not Recognized Means

The error 'python' is not recognized as an internal or external command, operable program or batch file appears in the Windows command line (CMD or PowerShell) when attempting to run the python command. The system cannot locate the python.exe executable file in the current folder or in the folders specified in the PATH environment variable. As a result, the python command is not available globally.

The error usually occurs immediately after installing Python or when using a new terminal without restarting the system.

Common Causes

  1. Python is not installed — the program is missing from the system.
  2. Python is installed but not added to PATH — the "Add Python to PATH" option was not selected during installation.
  3. The Python path in PATH is incorrect — for example, after updating Python, the path changed but the old entry remains.
  4. PATH changes have not taken effect — after adding the path, the command line or computer was not restarted.
  5. Python was installed for a single user — the path was added only to the user's environment variables, and you are working from a different account.

Solutions

Solution 1: Manually Add Python to the PATH Variable

This is the primary and most reliable method. You will manually tell the system where to find python.exe.

  1. Locate the Python installation folder
    Open File Explorer and navigate to:
    C:\Users\<Your_username>\AppData\Local\Programs\Python\
    Here you will see one or more folders with Python versions (e.g., Python39, Python310). Note the path to the desired version. You will also need the Scripts subfolder inside this folder.
  2. Open the Environment Variables editor
    Press Win + R, type sysdm.cpl, and press Enter.
    Go to the "Advanced" tab → click "Environment Variables".
  3. Add paths to the Path variable
    In the "System variables" section (or "User variables" if Python is installed only for you), find the Path variable and select "Edit".
    Click "New" and add two paths:
    • The path to the Python folder (e.g., C:\Users\Иван\AppData\Local\Programs\Python\Python39)
    • The path to the Scripts folder (e.g., C:\Users\Иван\AppData\Local\Programs\Python\Python39\Scripts)
  4. Apply the changes
    Click "OK" in all windows.
  5. Restart the command line
    Close all open CMD/PowerShell windows and open them again.
  6. Verify the command works
    Type:
    python --version
    

    If you see the Python version (e.g., Python 3.9.7), the error is resolved.

⚠️ Important: If you have multiple Python versions, add only one to PATH (the one you want to use by default), otherwise the system may run the wrong version.

Solution 2: Reinstall Python with Automatic PATH Addition

If you prefer not to configure PATH manually, reinstall Python and be sure to check the appropriate box.

  1. Download the Python installer from the official website.
  2. Run the installer.
  3. At the bottom of the installation window, check the box "Add Python to PATH" — this is critical.
  4. Select "Customize installation" (if you need to configure components) or "Install now" for a standard installation.
  5. Wait for completion.
  6. Restart the command line and verify with python --version.

Solution 3: Run Python Using the Full Path (Temporary Workaround)

If you need to run a script urgently and configuring PATH is not an option, use the full path to the executable.

For example:

"C:\Users\Иван\AppData\Local\Programs\Python\Python39\python.exe" script.py

This method does not require administrator privileges or system changes, but it is inconvenient for regular use.

Prevention

  • Always check "Add Python to PATH" during installation — this prevents the issue.
  • When updating Python to a new version, check your PATH — the old path may point to a removed version. Remove outdated entries from the Path variable.
  • Avoid moving the Python folder after installation — if you move it, PATH becomes invalid. It's better to reinstall Python in the desired location.
  • Regularly check PATH for non-existent paths using echo %PATH% (CMD) or $Env:Path (PowerShell).

F.A.Q.

Why is the 'python' command not recognized as an internal or external command?
How to check if Python is added to PATH?
What to do if the python command still doesn't work after adding to PATH?
Can I use Python without adding it to PATH?

Hints

Check Python installation
Find the path to the Python folder
Add paths to PATH variable
Restart the command line
Check the command works

Did this article help you solve the problem?

FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community