This was written in 2011. It may or may not be accurate today.
The most common problem with installing Python in Windows is that the installer does not place the Python installation directory on the Path.1) The Path is an environment variable that contains a list of directories that contain the executables that should be used as system commands. In other words, executables located in directories mentioned in the Path can be invoked at the command line using just the name of the executable (e.g., foobar
) rather than having to reference the location of the executable (e.g., C:\Some folder\that has\foobar.exe
).
So, when you try to run commands, Windows looks in the directories listed in the Path to find an executable with that name. If it finds it, it runs it. If it does not, it gives you the error shown below:
Adding the directory that contains the python
command to the Path is not difficult, but it's a little different for each version of Windows. Don't be afraid. As a budding programmer, this is something that you'll need to learn sooner or later, so you may as well learn how to do it now.
Here's how to do it in Windows XP:
C:\Python27
unless you (1) told the installer to place Python somewhere else or (2) installed a version of Python newer (or older) than 2.7. Open up an Explorer window to confirm the directory that Python is in and make a note of it.;C:\Python27
There is a ShowMeDo video that goes through the steps as well, but it's for an older version of Python, so be sure to change the name of the directory to the one your computer is using.
The process for Windows Vista and Windows 7 is very similar but not identical.
If you decide to uninstall Python, remember to remove from the Path the Python directory you added above.