Geany unable to execute Python

user1518770 picture user1518770 · Jul 11, 2012 · Viewed 15k times · Source

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?

Answer

Ry- picture Ry- · Jul 11, 2012

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