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

Installing PythonCard on your system requires the following steps:

  1. Download Python from the site.
  2. Download wxPython from the site.
  3. Download PythonCard from the PythonCard site.
  4. Install Python
  5. Install wxPython
  6. Install PythonCard
  7. Confirm the installation works

Downloading Python

If you're running Jaguar then you already have Python 2.2 installed on your system, but this isn't usable with wxPython, so you'll still need to download a "framework" build of Python.

Click on this MacPython-OSX-2.3-1.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- 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 Python

Python arrives 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-OSX-2.3-1.dmg), then double-click the MacPython-OSX.pkg icon and follow the instructions in the installation wizard. The installer will create a new directory /Library/Frameworks/Python.framework/Versions/2.3/ to contain the Python executables, documentation, tools, and standard libraries.

Installing wxPython

wxPython also comes as an installable disk image. Just double-click on the file you downloaded (it's called wxPythonOSX-, then double-click the wxPythonOSX-jaguar.pkg icon and follow the instructions. wxPython will be installed into /Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/.

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 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 /usr/local/bin/python install

By default, the PythonCard framework will be installed into /Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/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

It is important that you use the right version of Python to run wxPython and PythonCard scripts. Open the Terminal and then try running the Python that you just installed. Type Ctrl+D to exit the Python interpreter.

[mymachine:~] bob% /usr/local/bin/pythonw
Python 2.3 (#2, Jul 30 2003, 11:45:28)
[GCC 3.1 20020420 (prerelease)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D

Apple's Jaguar build of Python was not overwritten when you did the installation and is still available as /usr/bin/python. Since by default your PATH environment variable does not contain the /usr/local/bin directory, you can still run Apple's Python as shown below.

[mymachine:~] bob% python
Python 2.2 (#1, 07/14/02, 23:25:09)
[GCC Apple cpp-precomp 6.14] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D
[mymachine:~] bob% which python

But again, remember that wxPython and PythonCard scripts will not work with that version, so it is important when working in the Terminal to always use /usr/local/bin/pythonw.

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.

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.

Acid Test

OK, now comes the acid test. Open the folder called "minimal" in /Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PythonCard/samples. Find the icon labeled 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 1 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.

Minimal sample on Mac OSX
Figure 1. 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 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

SourceForge Logo Valid XHTML 1.0! Valid CSS!

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