skip to navigation
skip to content

Python on the Mac

Python on the Mac has the ability to work with

and much much more of the Mac infrastructure!

Python comes pre-installed on Mac OS X, but due to Apple's release cycle, it's often one or even two years old. The overwhelming recommendation of the "MacPython" community is to upgrade your Python by downloading and installing a newer version.

On Mac OS X 10.3.9 or 10.4, download and run an installer for the latest version. This is a Universal binary version of Python that runs natively on PPC and Intel systems.

On Mac OS X 10.3 (Panther), download and run this installer (which sets up the graphics environment for the Python development environment), and then download and run this other installer (which actually installs the newer Python).

As a bonus, once you've installed this power-user upgrade, you'll have a integrated development environment for Python called "IDLE" (look in the folder Applications / MacPython-2.4 -- here's a picture). You'll be able to easily install and use Python packages and extensions pre-built for the Mac. There's also a Wiki, and a FAQ, maintained by the community. And don't forget to join the MacPython SIG!

If you're using an older version of Mac OS, you should look at Jack Jansen's MacPython Page. Through Mac OS X 10.2 (Jaguar), Python for the Macintosh was maintained by Jack. And there are other Python downloads available for the Mac from other sources; there's a list of them in the MacPython Wiki.

If you're just curious...

You don't have to download anything. You can run a Python interpreter by double-clicking on Applications / Utilities / Terminal (here's a picture), then typing "python" into the window that opens up.

You'll see a prompt that looks like this:

Python 2.3.5 (#1, Mar 20 2005, 20:38:20) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 
(On Mac OS X 10.3 (Panther), it will say "Python 2.3.0", an older version.)

Try typing "2 + 2" and hit "Enter":

>>> 2 + 2
4
>>>
You've just evaluated your first Python expression. It's a simple environment, but good enough to work through the Python tutorial.

By the way, if you download the recommended upgrade mentioned at the top of this page, the "IDLE" development environment will make working through the tutorial a bit easier.