Home > Backend Development > Python Tutorial > How to Fix the \'\'python\' is not recognized...\' Error in Windows?

How to Fix the \'\'python\' is not recognized...\' Error in Windows?

Patricia Arquette
Release: 2024-11-02 19:00:30
Original
425 people have browsed it

How to Fix the

Adding Python to Windows PATH to Resolve Command Recognition Issue

When running "python" in a command prompt (cmd) window, encountering the error "'python' is not recognized..." indicates that Windows cannot locate the Python executable. To resolve this, add the Python executable path to the Windows PATH environment variable, which stores the locations of commands that can be executed from the command line.

Steps to Add Python to PATH:

  1. Right-click My Computer on the desktop and select Properties.
  2. Click the Advanced tab in the System Properties window.
  3. Click the Environment Variables button in the Advanced section.
  4. In the Systems Variable section, select the Path variable and click Edit.
  5. Add the Python executable path (;c:Python27) to the end of the value in the field, separated by semicolons (;).
  6. Click Apply to save the changes.
  7. Restart your command prompt (cmd.exe).

Once these steps are completed, the command prompt should recognize "python" as a valid command and allow you to execute Python programs. Note that adding the Microsoft version of Python from the Microsoft Store is generally not recommended for users who have already installed Python manually from python.org, as it may lead to conflicts in setup.

The above is the detailed content of How to Fix the \'\'python\' is not recognized...\' Error in Windows?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template