[DB-SIG] Getting a custom build of python to talk to MySQL

Richard richard@insane.bug-e.net
Sun, 23 Mar 2003 11:56:37 +0200

Hi List

This is my first post, so go easy please :)

I am an engineer, and not a programmer.  I have never quite got
my brain around OO, although I am quite happy to program in Fortran
(shock, horror!) and Perl.  I have been using Python for about 2
years.  Thus treat me as completely clueless.

What I want to do:
I have a scientific application that includes python as an embedded
macro language.  The entire user interface is also customisable in
python (very cool btw).  This app runs on Win32, linux and up to
multi-proccessor, million $ hardware, but I am running it on win32.

I want to get this app's python to talk to a database.  I have
access to MySQL on a freebsd machine.

I have tried to get MySQL-python 0.9.1 and 0.9.2 to talk to the
embedded python (is this the correct term?) but it will not work.

This is because the python is a custom build.  As follows:

Python 2.0 (#0, Jul  1 2002, 10:16:04) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Fatal Python error: Interpreter not initialized (version mismatch?)

This application has requested the Runtime to terminate it in an unusual
Please contact the application's support team for more information.


So, I guess that the answer is to do a custom build of MySQLdb, but I
do not have access to a C compiler etc etc.  

Any ideas how to get it to work ?

Worst case, someone shows me how to embed Perl inline into Python, and
I do the DB queries in Perl.  *yuck*  :)

Best regards