Qualitative analysis software for video and audio data  
Developed at the University of Wisconsin-Madison Center for Education Research  
Windows::
  Python
  wxPython
  MySQL for Python
  ctypes
  PythonWin
  pyMedia
  Internationalization
 

Setting up your Computer - Windows

Setting up MySQL for Python and Embedded MySQL for single-user Transana

Please note that the procedures described here work only with MySQL 4.0.25. We have not yet been able to get MySQL 4.1.14 to work in this configuration.

  1. Make sure your Python's "Lib\site-packages" 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.0.25. For the sake of these instructions, we will assume you installed it to "C:\MySQL Server 4.0.25", though you are free to install it wherever you would like. Please note that although you need to download and install the server-based version of MySQL, you don't actually need to set it up to run.

  3. Create a folder called "C:\MySQLtemp". We've had better luck with creating a temporary folder and copying necessary files to it than we've had trying to build MySQL for Python directly from the MySQL installation folder.

  4. Copy the folder "C:\MySQL Server 4.0.25\include" and all its files to "C:\MySQLtemp".

  5. Create a folder in "C:\MySQLtemp" called "libs". Copy
    "C:\MySQL Server 4.0.25\Embedded\DLL\release\libmysqld.exp" and "C:\MySQL Server 4.0.25\Embedded\DLL\release\libmysqld.lib" to this folder.

  6. Rename the two files you just copied to "mysqld.exp" and "mysqld.lib" respectively. (MySQL for Python seems to be unable to find them if you don't rename them.)

  7. Copy "C:\MySQL Server 4.0.25\Embedded\DLL\release\libmysqld.dll" to your program's source code folder. This is the embedded MySQL engine, and this file must be distributed with your program.

  8. Copy the folder "C:\MySQL Server 4.0.25\share" to 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.

  9. We must build MySQL for Python from source to get it to work with embedded MySQL. Therefore, download and install "MySQL-Python-1.2.0.tar.gz", the source code version of MySQL for Python 1.2.0. Unzip this archive and extract the files somewhere where you can find them and run Python code.

  10. Open a Command Prompt window. Change to the folder where you have put the files for MySQL for Python 1.2.0.

  11. If a "build" folder exists in your MySQL for Python source folder, delete it. Old versions of this folder can interfere with the build process.

  12. The next thing we need to do is set up three environment variables that MySQL for Python uses in its build process. Type the following three commands at the DOS prompt:

    set mysqlroot=C:\MySQLtemp
    set mysqlversion=4.0.25
    set mysqlclient=mysqld


  13. Edit MySQL for Python's "setup.py" file to add the line:

    extra_compile_args = None

    at the end of the "if sys.platform == 'win32':" block, at approximately line 61.

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

    python setup.py clean


  15. To build MySQL for Python using embedded MySQL 4.0.25, type the command:

    python setup.py build


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

    python setup.py install

  17. 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

This set of steps work for us for MySQL 4.0.25 and MySQL for Python 1.2.0. We have tried substituting MySQL 4.1.14, but were unable to get it to work correctly. If you are able to get MySQL for Python to work with embedded MySQL 4.1.x, please e-mail the developer with modified instructions and we will update this page.