GEOG 485:
GIS Programming and Automation

1.4.3 Installing Python and PythonWin

PrintPrint

If you installed the student version of ArcGIS, you should already have Python on your computer, typically in a folder called something like C:\Python27\ArcGIS10.2\. You can write Python code at any time in Notepad or other editors and save it as a .py file, but you need to have Python installed in order for your computer to understand and run the program.

In this course we’ll be working with Python version 2.7.x. If you check out the download page for Python from its home page at www.python.org (again, you won't have to download Python, just take a look!), you’ll see that there are actually higher versions of Python available. Python versions 3 and above contain some major changes that have taken some time for the Python user community and Esri to adopt.

Python comes with a simple default editor called IDLE; however, in this course you’ll use the PythonWin integrated development environment (IDE) to help you write code. PythonWin is free, has basic debugging capabilities, and is included on the ArcGIS DVD. The only catch is that it is not installed by default with ArcGIS; you have to do it manually by following the steps below. If you do not have the DVD you can download PythonWin here and execute the downloaded file to start the installation. Please make sure you use the "win32" version for Python 2.7 (pywin32-219.win32-py2.7.exe) not the "amd64" executables which are for installing the 64-bit version of PythonWin, which is only compatible with ArcGIS for Server, not ArcGIS for Desktop. Once you downloaded PythonWin continue with step 6 from the list below.

  1. Insert the ArcGIS Education Edition DVD into your computer.
  2. Dismiss any welcome screens that appear and choose Start > My Computer (or “Computer” on Windows Vista or Windows 7).
  3. Find your DVD drive, right-click it, and click Open. Your goal is to get to the folder structure of the DVD, not run the Auto Play that shows the Esri welcome screen.
  4. Once you’ve successfully displayed the folder structure, open the Desktop folder.
  5. Open the PythonWin folder.
  6. Start the install by launching pywin32-2xx.win32-py2.7. If you are using Windows Vista or Windows 7, right-click this file and choose Run as Administrator and, when prompted, choose to Allow it to run.
  7. Click Next through the wizard to install PythonWin.
  8. PythonWin doesn't put a Windows shortcut anywhere, so you get to make one yourself. Once the install completes, use My Computer (or "Computer") to browse to the location where you installed PythonWin. It's probably in C:\Python27\ArcGIS10.x\Lib\site-packages\pythonwin.
  9. Right-click the item PythonWin.exe and click Create Shortcut. You should see a Windows shortcut appear immediately below the PythonWin item.
  10. Drag and drop the shortcut onto your Desktop or wherever else you want to put it.

On Windows Vista or Windows 7, if you see error messages during install, it’s likely that you did not run the install as an Administrator. When you launch the install, make sure you right-click and choose Run as Administrator.