Installing Python and Atom on a Windows 7 or Mac OS X Computer

Python 2.7.x is the development language for this course and Atom is the IDE (integrated development environment) that we use to write, run, and debug our Python scripts (at least the ones that don�t run inside ArcGIS). The instructions here are general guidelines for getting the packages onto your Windows PC or Mac OS X computer. You can also set both environments up for Linux but since I don�t have a Linux machine right now, you will have to work that out on your own.

Installing Python

On a Windows PC:

First, check to see if you already have Python. Open up a command window. On Windows 7, click the Start button and type cmd in the text box (for other versions of Windows, google �open command prompt windows X�). A window with a command prompt will open. In the command prompt window, type python. If you get a message saying that Python is not recognized, then you will need to install it on your computer. If Python does start, check the version. If it is 3.x, you will still need to download version 2.7.x. Also, make sure that �Anaconda� is mentioned somewhere in the starting info. If it is not, you should continue with the installation instructions. Type quit() at the >>>> prompt and Python will exit.

If you do not have version 2.7.x of Python, click here to get the Python Anaconda distribution. Anaconda includes a Python interpreter and many other helpful tools for Python programming. Click the Python 2.7 Windows 64-bit graphical installer and follow the instructions.

On a Mac (OS X):

First, check to see if you already have Python. Open up Terminal. The easiest way is to open Spotlight with +space and type terminal in the text field. Double click on Terminal under applications. In Terminal, type python. If you get a message saying that Python is not recognized, then you will need to install it on your computer. If Python does start, check the version. If it is 3.x, you will still need to download version 2.7.x. Also, make sure that �Anaconda� is mentioned somewhere in the starting info. If it is not, you should continue with the installation instructions. Type quit() at the >>>> prompt and Python will exit.

If you do not have version 2.7.x of Python, click here to get the Python Anaconda distribution. Anaconda includes a Python interpreter and many other helpful tools for Python programming. Click the Python 2.7 Mac OS X 64-bit graphical installer and follow the instructions.

Installing Atom

Atom is an integrated development environment (IDE�editor and run time tools) available for both Windows PCs and Macs running OS X. Click here to get Windows and Mac OS X installers.

For Windows, click Download Windows Installer. Run it and follow the instructions.

For Mac OS X, click Download for Mac. Run the downloaded file atom-mac.zip. That�s it.

Installing Script

Script is a tool that lets Atom run the Python scripts you create in this course. To install Script:

On Windows:

Start Atom.

Click File�Settings

Click Install. Type Script in the text window and click Install (blue button that says Install). Atom will go out and get this package and install it for you.

On the Mac:

Click Atom�Preferences�

Click Install. Type Script in the text window and click Install (blue button that says Install). Atom will go out and get this package and install it for you.

Testing your installation

Click File�New file

Click File�Save As and save your file somewhere as HelloAtom.py (the .py extension is very important!)

Click the new tab for HelloAtom.py in your editor to select it for editing and type (exactly as following):

print 'hello Atom!'

Please note: It�s always best to type these examples in case my word processor throws in funny single or double quotes that Atom can�t deal with

Now run your Python script. If you are running Atom on Windows, type Shift-Ctrl B on the keyboard (hold down Shift and Ctrl and then type B). If you are on the Mac, type command-i (hold down the command key and then the letter i). In either case, you should see hello Atom! at the bottom of the screen. All is well.