I want to be able to run Python commands from the Windows CMD. However, if I don't specify Python's full path for each command, I get an error saying "Python is not recognized as an internal or external command, operable program or batch file."
How do I add Python to the Windows PATH permanently?
Best Answer
For Windows 10/8/7:
System Properties
(Right clickComputer
in the start menu, or use the keyboard shortcut Win+Pause)Advanced system settings
in the sidebar.Environment Variables...
PATH
in theSystem variables
sectionEdit
Add Python's path to the end of the list (the paths are separated by semicolons). For example:
For Windows XP:
System Properties
(Type it in the start menu, or use the keyboard shortcut Win+Pause)Advanced
tabEnvironment Variables...
PATH
in theSystem variables
sectionEdit
Add Python's path to the end of the list (the paths are separated by semicolons). For example:
Test on a new terminal window or if using an integrated terminal within a text editor, close and restart your editor or the changes won't be applied.