Installing PythonCard on your system requires the following
steps:
- Download Python from the python.org site.
- Download wxPython from the wxPython.org site.
- Download PythonCardPrototype from the PythonCard site.
- Install Python
- Install wxPython
- Install PythonCardPrototype
- 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-2.4.1.2-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
PythonCardPrototype-0.7.1.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-2.4.1.2-py2.3.dmg), then double-click the wxPythonOSX.pkg icon and follow the instructions. wxPython will be installed into
/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/wxPython
.
A "wxPythonOSX-2.4.1.2" folder will also be created in your "Applications" folder that contains the wxPython demo (RunDemo) and a Python interpreter (PyShell) along with some other samples.
Installing PythonCardPrototype
The PythonCardPrototype-0.7.1.tar.gz file you downloaded should automatically be decompressed by Stuffit; if the file isn't already decompressed, then double-click the PythonCardPrototype-0.7.1.tar.gz file. You should now have a PythonCardPrototype-0.7.1 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/PythonCardPrototype-0.7.1
[mymachine:~/Desktop/PythonCardPrototype-0.7.1] bob% sudo /usr/local/bin/python setup.py install
By default, the PythonCard framework will be
installed into
/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PythonCardPrototype
.
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
/usr/bin/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/PythonCardPrototype/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 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.
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 PythonCardPrototype 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