Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Python from Windows cmd [duplicate]

I am trying to run a python program in Windows with a call like this:

python pacman.py

I have many such calls to the python program. I want to run it from windows command line. When I run this in Ubuntu it works well but when I try it in Windows, I get the following error:

'python' is not recognized as an internal or external command, operable program or batch file.

How can I run these python programs from Windows cmd?

like image 314
user1210233 Avatar asked Mar 02 '13 04:03

user1210233


2 Answers

You need to modify the Windows %PATH% environment variable. Under My Computer ‣ Properties ‣ Advanced ‣ Environment Variables, you should modify the %PATH% variable to include your Python directory, i.e. C:\Python26.

See: http://docs.python.org/2/using/windows.html#excursus-setting-environment-variables

like image 134
Matt Avatar answered Sep 20 '22 00:09

Matt


That means Python Path isn't declared. Try this:

cd --> to pacman.py dir
C:\PythonVersion\python.exe pacman.py
like image 44
Norton Penguinion Avatar answered Sep 18 '22 00:09

Norton Penguinion