How to add Python to PATH variable in Windows ?

 The executable files for each command are located in the folders listed in the PATH variable.



When a command is put into the Windows command prompt, the prompt looks for an executable file with the same name in the PATH variable; if the required file is not found, it responds with an error message that specifies that the supplied command was not recognised.

Writing the entire directory of the executable file instead of just the command name is one technique to fix this error. This method is not very user-friendly, though.

Including the executable file's directory in the PATH variable is another potential and less difficult workaround for this problem. This is frequently necessary while installing Python.

You can add the full path to python.exe by:

  1. The Properties menu can be accessed by right-clicking This PC.
  2. Selecting the Advanced system settings option from the left menu.
  3. Selecting the Environment Variables button, which is located in the bottom right.
  4. Selecting the Path variable and clicking Edit in the System variables section. All of the directories that are currently included in the PATH variable will be displayed on the following screen.
  5. By selecting New and choosing the Python installation location.
Now, Python can be used straight from the command line without needing to provide its location. Try using python —version to find out what version of Python is currently installed on your machine.

you can find the python installed binary in this path location: C:\Users\mahim\AppData\Local\Programs\Python\Python39







Comments