python mySQL module

I was hoping I would be able to connect to a mySQL database from a connectPort X8. I am new to python and am trying to import the pre-built module from:

http://sourceforge.net/projects/mysql-python/

Everything I have tried thus far returns errors. From what I read, the prebuilt module was most likely built for a different version of python than built into the connectPort. “import _mysql” returns:

ImportError: No module named pkg_resources

I’m trying to go straight to the database without going through anything else. Is what I’m trying to do possible?

DigiGuy42 offered the following in response to a similar question in another thread:


Re: Gateway database connection
Posted: Dec 15, 2008 2:35 PM

I am unaware of any direct database interface libraries that would be runnable on the X8 gateway. Most of these Python modules have built-in C code that gets compiled in as an extension to interface with the database.

What you may wish to do is to segment your application and have the portion which modifies the database run on the server as well and translate data, in your own format, coming from the gateway into the database.

you have an idea to solve this problem