Qualitative analysis software for video and audio data  
Developed at the University of Wisconsin-Madison Center for Education Research  

Development ::
  Overview
  Development Log
  Release Schedule  
  Open Source Info
  Internationalization
  Source Code

To move around within this setup procedure, use these links:

  OS X
  Python
  wxPython
  MySQL for Python
  ctypes
  Internationalization

 

Setting up your Computer - Mac OS X 10.3

MySQL and MySQL for Python

Transana uses a database called MySQL to store all of the analytic data. MySQL is a very powerful, very popular, open-source database program. It is available at http://www.mysql.com, as are a number of tools for working with MySQL databases. MySQL is documented extensively at that site. We currently use version 4.1.14-max for Transana on the Mac.

Transana uses MySQL for Python to connect to MySQL from within Python. MySQL for Python is available at http://sourceforge.net/projects/mysql-python. Documentation of this component is uneven, and the installation process is not completely straightforward based on the documentation. Therefore, we will attempt to describe what we have gotten to work here. We currently use version 1.2.0 of MySQL for Python.

We deal with the installation of these two components together because they must be installed together as a pair.

Setting up MySQL for Python and MySQL

  1. Make sure your "/Library/Python/2.3" folder does not have a MySQLdb folder, and that there are not files called "_mysql.pyd", "_mysql_exceptions.py", and "_mysql_exceptions.pyc". Depending on how the previous installation was done, you need to either uninstall MySQL for Python or delete these files manually.

  2. Download and install MySQL 4.1.14-max for OS X 10.3.

  3. Copy the contents of folder "/usr/local/mysql/share/mysql" to a folder called "share" in your program's source code folder. This folder contains the internationalization prompts for MySQL, and the prompt files must match the MySQL version being used.

  4. Download and unpack MySQL-python-1.2.0.tar.gz.

  5. Open a Terminal window and change to the folder where you unpacked MySQL for Python.

  6. If you want to work with single-user Transana, enter:

    export mysqlclient='mysqld'

    If you want to work with multi-user Transana, you can ignore this command.

  7. If a "build" folder exists in your MySQL for Python folder, delete it before proceeding. Previous builds can interfere with the process, and if you are changing from single-user to multi-user development, failure to delete the build folder can cause a variety of mysterious failures.

  8. On one computer, the following commands just worked. On another, I got several "sh: line 1: mysql_config: command not found" errors, indicating that the OS could not find the "mysql_config" command that the setup.py file required. To fix this, I had to edit the MySQL for Python "setup.py" file to specify the correct location of this file. I changed line 65 from:

    return popen("mysql_config --%s" % what).read().strip().split()

    to:

    return popen("/usr/local/mysql/bin/mysql_config --%s" % what).read().strip().split()


  9. To further ensure that previous install attempts don't interfere with this install, type the command:

    python setup.py clean

  10. To build MySQL for Python using MySQL 4.1.14, type the command:

    python setup.py build

  11. To install the MySQL for Python package to your Python installation, type the command:

    python setup.py install

  12. Finally, when you start working on Transana, you will need to edit the TransanaConstants.py file. At approximately line 31 of this file, the "singleUserVersion" variable is declared. To work with this configuration of Embedded MySQL and MySQL for Python, the singleUserVersion variable must be set to True.

    singleUserVersion = True

    To work with server-based MySQL and that build of MySQL for Python, the singleUserVersion variable must be set to False.

    singleUserVersion = False

    If you haven't already done so, you will need to set things up for the multi-user version of Transana if you intend to develop for the multi-user version. This process is described in the Transana Multi-user Installation Guide 2.20.

    Ultimately, the singleUserVersion variable and the MySQL for Python build must match for Transana to run properly form source code.

The next step is to set up cTypes.