Installing PyMT on OSX (from git repository)

These instructions are for pymt version 0.4 and later (install pyglet instead of pygame otherwise)

These instructions are based off of me installing pymt on a clean install of OSX Snow Leopard (10.6)

Overview

Here is the quick way of installing on OSX, the rest of the sections will have a little more detail for everything.

Download and install the following installer packages (Python 2.6, pygame, and numpy)

Download and install Python (from python.org)

We are going to use the official python version (2.6.4), because the one that comes with OSX can be a real pain when you start installing 3rd party packages. You can download the installer here: http://python.org/ftp/python/2.6.4/python-2.6.4_macosx10.3.dmg

Install Dependencies

pygame

Download and run the installer: http://pygame.org/ftp/pygame-1.9.1release-py2.6-macosx10.5.zip

numpy

Download and run the installer: http://downloads.sourceforge.net/project/numpy/NumPy/1.3.0/numpy-1.3.0-py2.6-macosx10.5.dmg?use_mirror=softlayer

TODO: I wish I could find a way to automatically install the binary releases of pygame and numpy using a script. Then users wouldnt have to manually install...and I could install pymt completely inside a virtualenv. easy_install and pip however only know how to install numpy and pygame from source, which not only requires xCode but a bunch dependencies (SDL, Fortran compiler etc..). So for now, these two packages are easiest to install with their binary installer packages for OSC

Install pymt from git

if you dont have git installed, do that first. You can get it here: http://git-osx-installer.googlecode.com/files/git-1.6.5.1-UNIVERSALbinary-leopard.dmg

Cloning the pymt git repository

Open a console and go to the directory where you want the pymt repository to be. Here is what I did; this will install pymt to /Users/<username>/code/pymt

Type the following commands:

mkdir code
this creates a directory called code inside your hoe directory
cd code
now your inside the code directory you just created
git clone git://github.com/tito/pymt.git
This will grab the latest pymt code from Mathieu's repository on github. It might take a little bit, but once its done you have everything you need inside code/pymt

Installing PyMT

Now you can wither install pymt to the system like any other package, or set your PYTHONPATH so that python can find pymt where you have it (this is nice if you want to hack on pymt, because you can change the source in place and not have to reinstall everytime you make a change

OPTION A

Installing to site-packages (insatlled pymt to python). Do this f you know your not going to change the pymt source code yourself.

cd pymt
sudo python setup.py install

OPTION B

Setting PYTHONPATH environment variable, so that python can find pymt where you have it (Do this if you might want to change the pymt source code...dont be afraid..its fun!)

Make sure you change the directory names below, if you installed pymt to somewhere other than <your_home_directory>/code/pymt

export PYTHONPATH=$PYTHONPATH:~/code/pymt
This adds the directory /Users/<your_username>/code/pymt to the PYTHONPATH environment variable. This will only take effect until the end of your terminal session.

If you want to make add the directory to your PYTHONPATH permanently (everytime you load the terminal. Do the following:

echo 'export PYTHONPATH=$PYTHONPATH:~/code/pymt' >> ~/.bash_profile

Testing to make sure everything went fine

You should be all set. You can run one of the examples to make sure.

cd ~/code/pymt/examples/touchtracer
python touchtracer.py
If all went well the touchtracer example should run. By default you can simulate touches using your mouse (use right mouse button to make touches stay). See the configuration section to configure your specific input devices.

go have fun..what are you waiting for, write some awesome multi-touch application!