'Python not recognised as an internal or external command in windows 7

I have installed python 2.7.11 from this link and then restarted my system. However when I go to cmd and run python --version. It gives me an error that

python not recognized as an internal or external command.

So I try to manually add it to my Path variable I see my python being installed at C:\Python27 so I add someotherpath;C:\Python27 to path variable and reopened windows cmd. But it still gives me the same error.

Is there some other way to get over with this problem.

Thanks



Solution 1:[1]

Python2.7 contains a scripts that adds location to path for windows.

So running

C:\Python27\Tools\Scripts\win_add2path.py

solved my issue

Solution 2:[2]

Please run the following command in the command prompt.

echo %PATH% It should have whatever path you have set manually. Otherwise Open a new Command prompt and try the same command. Run python

If it is not working after that.

Please kindly check the Python.exe is available in C:\Python or Not ?

Solution 3:[3]

Changes in PATH variable do not affect already open programs. Close your command line (or powershell) window and reopen it in order to use new PATH variable.

Solution 4:[4]

I got same error there are two ways to solve 1)Try using py --version

2)If py is also not recognised than uninstall python and install it again but select the add to path optionas show in fig this time

Solution 5:[5]

Easiest way to fix this is to reinstall Python and check "Add to Path" button during the installation.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Mouli
Solution 3
Solution 4
Solution 5 Fejs