A Byte of Python

Chapter 2. Installing Python

Table of Contents

For Windows users
Using Python at the Windows prompt
For Linux/BSD users
For Mac users
Summary

For Windows users

Visit the ActivePython Downloads page and download the MSI file of the latest version of Python (which was 2.4 as of this writing). Double-click this file and start the installation.

Note

Note that the official versions of Python are available from python.org/download. I recommend using ActiveState's installer for Python since their Windows version comes with other useful utilities such as bindings to the Win32 API.

An interesting fact is that about 70% of Python downloads are by Windows users. Of course, this doesn't give the complete picture since almost all Linux, BSD and Mac users will have Python installed already on their systems by default.

Using Python at the Windows prompt

In order to use Python from the Windows DOS prompt, we need to set the PATH environment variable appropriately.

For Windows 2000, XP and 2003, click on Control Panel -> System -> Advanced -> Environment Variables. In the System Variables section, click on the variable named PATH, then select Edit and add C:\Python24 to the end of the information already present. Make sure you are adding the correct folder path.

For older versions of Windows, add the line PATH=%PATH%;C:\Python24 to the file C:\AUTOEXEC.BAT and restart the system. For Windows NT, use the AUTOEXEC.NT file.