[Zope] Disappointment with mysql DA under win

Andy Dustman andy@dustman.net
17 Sep 2001 19:38:58 -0400


On Mon, 2001-09-17 at 19:06, f.stefanelli wrote:

> a)
> mysql-python-0.9.0.win32-py2.1.exe; egenix-mx-extension; zmysqlda 2.0.8
> the installation dir for the first two is c:\python21

Side note: you don't need the egenix stuff for ZMySQLDA. MySQLdb will
use mx.DateTime, if it is available, but not with ZMySQLDA. ZMySQLDA
uses Zope's DateTime.
 
> with this I get this error after zope restart (there is the image of a
> brokenproduct: zmysqlda):
>     import _mysql
> ImportError: No module named _mysql

> b)
> I download the source of mysql-python (mysql-python-0.9.0) and distutils
> 1.0.2. I set the path to c:\zope\bin and  i do:
> python setup.py install (for distutils) and
> python setup.py build (for mysql-python) at this point after some lines
> there is an error it says that cannot find cl.exe (I also try to search 
> on hard disk for cl.exe, but nothing)and exit...

I don't know what cl.exe is.

Generally speaking, if Zope has raises ImportError on importing _mysql,
this means that MySQLdb is not installed where Zope can find it. If you
are compiling it yourself, you must use the same python binary that Zope
uses when it runs. I assume this is what you are trying to do in the
second example. The prebuilt MySQLdb probably doesn't install in your
Zope installation but in your normal Python installation. If you copy
those files into $ZOPEHOME/lib/python, it should work. You need to copy
three things: a) _mysql.so (probably _mysql.pyd for windows), b)
_mysql_exceptions.py, c) the MySQLdb directory and contents.

-- 
Andy Dustman         PGP: 0x930B8AB6
    @       .net     http://dustman.net/andy
You can have my keys when you pry them from my dead, cold neurons.