Shubham Khatri
Shubham Khatri

Reputation: 281686

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

Upvotes: 0

Views: 5292

Answers (5)

Anonymous
Anonymous

Reputation: 11

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

Upvotes: 1

Shubham Khatri
Shubham Khatri

Reputation: 281686

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

So running

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

solved my issue

Upvotes: -1

Fejs
Fejs

Reputation: 2888

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

Upvotes: 0

Mohammad Jafar Mashhadi
Mohammad Jafar Mashhadi

Reputation: 4251

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.

Upvotes: 2

Mouli
Mouli

Reputation: 299

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 ?

Upvotes: 2

Related Questions