[Zope] ZMySQLDA broken with Redhat 9?

Josh Trutwin josh at trutwins.homeip.net
Sat Aug 23 17:03:38 EDT 2003


 
> I cannot seem to get ZMySQLDA to work on Redhat 9.

<snip>

> Here is the traceback:
> 
> Traceback (most recent call last):
>   File "/var/zope/lib/python/OFS/Application.py", line 541, in 
> import_product
>     product=__import__(pname, global_dict, global_dict, silly)
>   File "/var/zope/lib/python/Products/ZMySQLDA/__init__.py", line 91, 
> in ?
>     import DA
>   File "/var/zope/lib/python/Products/ZMySQLDA/DA.py", line 92, in ?
>     from db import DB
>   File "/var/zope/lib/python/Products/ZMySQLDA/db.py", line 89, in ?
>     import _mysql
> ImportError: No module named _mysql

<snip>

For my installation, _mysql.so is in zope/lib/python2.1/site-packages. (where zope is my location of zope)

What does rpm -ql MySQL-python show?  If this is an RPM install, it probably set MySQL-python up so it could only be used with your standard python installation, but not with Zope's python.  To make it works with zope you might have to copy some files around.  I found it easiest to do a source installation of MySQL-python, you could try that too.  Download MySQL-python from sourceforge, unpack it and go to the MySQL-python directory and type:

/your/path/to/zope/bin/python setup.py build
su
/your/path/to/zope/bin/python setup.py install

Make sure you type the full path to the python located in the zope installation.  This uses the python executable within Zope so it puts the files in the right place for Zope to see them.  Restart Zope and you SHOULD be good to go.  (Note that this actually uses the C compiler to build _mysql.so, so make sure you have gcc installed).  

Josh







More information about the Zope mailing list