[Zope] MySQL and Zope products problems

Dieter Maurer dieter@handshake.de
Wed, 30 Jan 2002 01:29:22 +0100


Richard Hewison writes:
 > We have recently tried to install MySQL on our server (SuSE Linux 7.3 
 > based) as well as a few Zope products (ZMySQLDA, SQL Blender). The 
 > first signs of things not working was when the ZMySQLDA was showing up 
 > in Zope 2.4.3 as a broken product. Looking at the server itself indicated an 
 > import error during the starting up of Zope: 
 > "Zope could not import Products.ZMySQLDA" and "ImportError: No 
 > module named _mysql" 
 > We've installed an rpm of MySQL (v3.23.47-1) for Linux as well as 
 > MySQL Python v0.9.0 (which we had to build and install as it wasn't a 
 > binary version). According to the instructions for ZMySQLDA, it says: "If 
 > you are using a binary package of Zope, you need run setup.py with Zope's 
 > python executable. Otherwise, Zope (ZMySQLDA) will not be able to find 
 > _mysql.". 
 > What exactly does this mean when it talks about "...Zope's python 
 > executable"?
I expect that you should use the same "python" that is used to
start Zope.

I expect, that it is not really necessary, though helpfull.
The python executable running "setup.py" must however be similar
to the python executable running Zope. E.g., both need to be
configured for threading.

Your problem is probably caused by one of the following potential problems:

  *  "_mysql" is not found by Zope because it is not in the PYTHONPATH.

     Either extend PYTHONPATH or make a symbolic link from some directory
     in the PYTHONPATH to "_mysql.so".

     Search the mailing list archives (e.g. via Google), if this
     information should not be enough.

  *  "_mysql" is found but importing it leads to a problem, usually
     because the "libmysql.so" shared object is not found.

     You can solve this problem by setting "LD_LIBRARY_PATH"
     or reconfigure "ld.conf". See the dynamic linker documentation
     for details.


Dieter