Home | Previous | Next | Huddart Site Map
Installing Python on a Windows computer
Instructions on How to Install Python
by Scott Collins
Last Revised August 26, 2013
First, a link to a great Python tutorial: A Byte of Python
Versions 2.X and 3.X are commonly used today. Version 3 changes some of the standard syntax associated with Version 2. For example, to print "hello world" the new version requires the addition of parentheses as shown in the following code:
In contrast, the older versions (v. 2.x) followed more traditional syntax:
print 'hello world'
If you wish to also install the free Integrated Development Environment (IDE) called DrPython, you will also need to install wxPython. As of today (11/07/08), the wxPython platform appears to only be compatible with versions of Python up to v2.6. Accordingly, I might suggest installing Python 2.6 and then upgrading to v3.0 at a later date.
Steps to install
- Choose the version of python you wish to use here: http://www.python.org/download/releases
- Click on the "Windows x86 MSI Installer" link. A window will open with an option to either save the file or run it directly from the Python website. Either download the file and run it from your local hard drive or run it directly from the Python website. A Windows installation wizard will appear. Click through the options to begin installing Python to your local hard drive.
- You can now run Python from your DOS command prompt (click "Start," then "Run," then enter "cmd" in the "Open" field). You will need to change your DOS directory to the directory you chose during the installation process before typing "Python.exe" in the command line. You can now test to see if Python was properly installed by typing something like "2+2" or by typing syntax like the "hello world" program listed above. A proper output will ensure that Python has been properly installed.
- After looking at several free Integrated Development Environment (IDE) programs for Python, I recommend installing the DrPython IDE, which runs on a platform called wxPython. If you wish to install DrPython, you first need to install wxPython from the following website:
Scroll down until you reach the "Microsoft Windows" section. In the "Python 2.6" column, click on the "win32-ansi" link, which will trigger a download from a third-party site called SourceForge.net. If you have a pop-up blocker activated on your local computer, you may need to give permission to download the file.
A window will open with an option to either save the file or run it directly from the SourceForge website. Either download the file and run it from your local hard drive or run it directly from the SourceForge website. A Windows installation wizard will appear. Click through the options to begin installing wxPython to your local hard drive. The installation wizard should attempt to install wxPython to a sub-directory beneath the parent Python directory you created in step 2 above. If the installation wizard does not attempt to create a sub-directory, manually create the following directory during the installation process:
- Download DrPython from the SourceForge website (green download box):
Click on the "download" link in the green box, then click on the "download" link for v3.11.0, and finally click on the drpython-3.11.0.zip link. The last link will trigger a download in the same manner as for wxPython. If you have a pop-up blocker activated on your local computer, you may need to give permission to download the file. A window will open with an option to either save the file or run it directly from the SourceForge website. As this is a .zip file, I recommend saving this file to your desktop and then unzipping it to a separate file directory (next step).
- To unzip the DrPython files, right-click on the .zip file you saved to the desktop and then select "extract all." A Windows extraction wizard will open. There is no Windows installation wizard associated with DrPython. The files stand alone. You will need to manually select the directory where you wish to extract the .zip files. One suggestion might be to create a sub-directory called "DrPython 3.11.0" beneath your parent "Python26" directory. Another suggestion might be to create the directory at the same directory level as your "Python26" directory. I chose to install DrPython as a sub-directory beneath my parent Python directory.
- DrPython is written in Python, so you will not find a DrPython.exe file. Three files exist in your DrPython directory called "DrPython" in your new DrPython sub-directory, and any of the three will open DrPython. I have chosen to create a shortcut on my desktop for the extended filename "DrPython.py" (not "DrPython.pyc" or "DrPython.pyw"). No reason for this, other than my preference in what opens with Python.
- To test Python in your new DrPython IDE, click on the "Python" button (the green snake) in the second toolbar from the top of your DrPython screen. A Python session will open in the lower-half of your DrPython screen. Test Python in the same way described in step 3 above. A proper output will ensure that DrPython has been properly installed.
- Hack away! You are now up and running with Python.
Smeal College of Business, Penn State University, University Park, PA 16802-3603 USA
Home | Previous | Next | Huddart Site Map
was last updated on
Tue, Aug 21, 2018.
Thu, Sep 19, 2019.
Unless otherwise noted, all material is:
Copyright ©1995-2018 Steven Huddart. All rights reserved.