0

When you install python on windows, you have to set the path by going to the Environment Variables, then click New, enter the name, then in the value place enter the path, finally edit the path and add %pythonexe%; to it. When you do this, you can type python and you will get the python shell. Is there an easier way to do this without having to go to the system variables, and doing all that stuff?

xilpex
  • 2,716
  • 2
  • 10
  • 38
  • 2
    The installer has an option to modify `PATH` for you, which will add the installation directory and "Scripts" subdirectory. It also adds ".PY" to `PATHEXT`, at least in 3.5+ it does. – Eryk Sun Mar 26 '19 at 15:42

1 Answers1

0

According to this post all you have to do is type this in Command Prompt:

setx path "%path%;C:\Python27;"
xilpex
  • 2,716
  • 2
  • 10
  • 38
  • 2
    Never use setx.exe to modify `PATH`. It makes a mess. `PATH` is a special environment variable that's loaded by expanding and joining separate system and user "Path" values from the registry. This setx.exe command stores the entire value to the user "Path" value. It also loses the generality of the non-expanded variables (e.g. "%SystemRoot%" or "%ProgramFiles%") in the registry value. – Eryk Sun Mar 26 '19 at 15:39