Installing PythonCard on Mac OS X (Panther)
Author: Kevin Altis

# How to Install PythonCard on Mac OS X (Panther)

The instructions below are for installing PythonCard on Mac OS 10.3 (Panther). If you are using Mac OS 10.2 (Jaguar), then please use these instructions instead.

Installing PythonCard on your system requires the following steps:

1. Download MacPython add-ons from MacPython site.
2. Download wxPython from the wxPython.org site.
3. Download PythonCard from the PythonCard site.
4. Install MacPython add-ons
5. Install wxPython
6. Install PythonCard
7. Confirm the installation works

## Downloading MacPython add-ons

If you're running Panther then you already have Python 2.3 installed on your system, but we want to get the MacPython add-ons to get the PackageManager and PythonLauncher.

Click on this MacPython-Panther-2.3-2.dmg link to begin the download. Most Mac OS X browsers will save the file to your desktop.

## Downloading wxPython

PythonCard relies on the wxPython package. Click on this wxPythonOSX-2.5.2.8-panther-Py2.3.dmg link to begin the download. Again, most Mac OS X browsers will save the file to your desktop.

## Downloading PythonCard

The latest version of PythonCard is always available via the PythonCard download page. Click on this PythonCard-0.8.2.tar.gz link to begin the download. Again, most Mac OS X browsers will save the file to your desktop.

## Installing MacPython add-ons

The MacPython add-ons arrive at your system as an installable disk image. All you have to do is double-click on the file you downloaded (it's called MacPython-Panther-2.3-2.dmg), then double-click the MacPython-Panther.pkg icon and follow the instructions in the installation wizard. The installer will create a MacPython-2.3 directory in your Applications folder.

## Installing wxPython

wxPython also comes as an installable disk image. Just double-click on the file you downloaded (it's called wxPythonOSX-2.5.2.8-panther-Py2.3.dmg), then double-click the wxPythonOSX-panther.pkg icon and follow the instructions. wxPython will be installed into /Library/Python/2.3/. Note that this is the same directory as /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/ since the two directories are connected by a symbolic link in the file system.

I recommend creating a wxPython folder in your Applications folder and copying the Apps, Docs, Samples, and README 1st.txt files to the wxPython folder.

## Installing PythonCard

The PythonCard-0.8.2.tar.gz file you downloaded should automatically be decompressed by Stuffit; if the file isn't already decompressed, then double-click the PythonCard-0.8.2.tar.gz file. You should now have a PythonCard-0.8 directory on your desktop. Open the Terminal application and do a cd to that directory and then run the setup.py script using the 2.3 Python you just installed. The sudo command will prompt you for your password.

[mymachine:~] bob% cd ~/Desktop/PythonCard-0.8
[mymachine:~/Desktop/PythonCard-0.8] bob% sudo python setup.py install

By default, the PythonCard framework will be installed into /Library/Python/2.3/PythonCard/. You'll probably want to make an alias to this directory to keep on your desktop or home folder to make it easier to get to the PythonCard tools and samples.

## Confirming Installation

To run GUI scripts on Mac OS X (i.e. wxPython and PythonCard scripts) from the Terminal you must start them with pythonw rather than the plain python interpreter.

### Configuring PythonLauncher

The default install leaves .py and .pyw files associated with the Python IDE rather than PythonLauncher which is the app used to run Python scripts from the Finder. PythonLauncher is located in your Applications/MacPython-2.3 folder

If you select a .py file you can choose Get Info from the File menu and then change the files to open with PythonLauncher instead of the IDE if you want to be able to double-click a file and have it run. Repeat the process for .pyw files. Alternatively, you can hold down the control key and when you click on a .py file then you can select PythonLauncher from the Open With menu item.

Figure 1. PythonLauncher Preferences

### Acid Test

OK, now comes the acid test. Open the folder called "minimal" in /Library/Python/2.3/PythonCard/samples. Find the icon labeled minimal.py and double-click it. In a few moments (after an operating system console window has appeared), a small window like the one shown in Figure 2 will appear. This indicates that your installation was successful and everything is working. Close the minimal application in the usual way and proceed with the Walk-Through.

Figure 2. PythonCard minimal application window open to confirm installation is correct

If for some reason this test fails, go back over these instructions carefully. In particular, make sure that wxPython and PythonCard both appear in the site-packages folder in Python's Lib folder.

If everything seems OK and you still can't get minimal.py to launch, post a message to the PythonCard Users Mailing List. (If you aren't yet a member, visit the list management page and join.)

Back to Walk-Through

$Revision: 1.2 $ : $Author: alextweedly $ : Last updated $Date: 2006/04/06 11:00:25 $