How to install Python 2.7 on Windows 7. ‘python’ is not recognized as an internal or external command.

It seems this problem is more common than we’d like to admit to ourselves, but the solution is quite simple! Many developers install Python on their Windows 7 machine and when they try to run the console command Python they get the following error message:

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

Follow the steps below to see how to install and start coding in Python on Windows 7.
First visit the official Python page and download the latest release. At the time of this writing the latest version is 2.7.

Install it by double clicking the setup file and follow the wizard along.

Next, let’s open the Start Menu and right click My Computer. Click on Advanced System Settings.

Then click on Environment Variables.

Find the PATH variable and click Edit. You want to add ;C:\Python27 to the end of that string. Save your changes!

So what exactly is happening here?

When you type in ‘python‘ in a command prompt, Windows will use the PATH variable to get a list of directories to go looking for the ‘python‘ command. Before you followed the steps here, it couldn’t find the python.exe file, hence the error.

Now that the PATH variable is set, when you use ‘python‘ you’ll see a familiar programming prompt.

Python running in Windows 7.

Python running in Windows 7.

Tags: ,

3 Responses to “How to install Python 2.7 on Windows 7. ‘python’ is not recognized as an internal or external command.”

  1. Daniel Robles P April 28, 2012 at 7:45 pm #

    Note: add C:Python27Scripts to the path, it is usefull for install packages using easy_install or pip

Trackbacks/Pingbacks

  1. How to execute a Python program through a file or the shell | Python Central - March 15, 2012

    [...] that you already have Python installed and running well (if you’re getting an error, see this post), now open the terminal or console and type ‘python’ and hit ‘Enter’ key, then you will be [...]

  2. Sling Bag - May 15, 2012

    click to read…

    [...]the time to read or visit the content or sites we have linked to below the[...]…

Leave a Reply