Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geany unable to execute Python

I'm not a great coder, in fact I'm just trying to learn, but I can't get Geany to regonise Python in my system (Windows 7) when I try to execute the program. When I click Execute, it opens a command prompt saying:

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

How can I fix this?

like image 260
user1518770 Avatar asked Jul 11 '12 19:07

user1518770


2 Answers

Add the Python executable to your PATH. For example, I have Python installed at:

C:\Program Files\Python 3.2

So press Win + Pause/Break, and go to "Advanced System Settings":

System settings

Click "Environment Variables" at the bottom, add a new user variable called PYTHONDIR, and set it to your Python installation directory:

Adding a new environment variable

Then, look for another variable there called PATH. If there isn't one, create one and give it the value %PYTHONDIR%; otherwise, append ;%PYTHONDIR to the existing one. It should work fine now.

Adding the PYTHONDIR to the PATH variable

like image 111
Ry- Avatar answered Sep 27 '22 20:09

Ry-


Or you can skip the New User Variable. Find the PATH variable and click Edit. You want to add ;C:\Python27 to the end of that string. Save your change.

via: http://pythoncentral.org/how-to-install-python-2-7-on-windows-7-python-is-not-recognized-as-an-internal-or-external-command/

like image 34
noonan Avatar answered Sep 27 '22 18:09

noonan