Disappointment with mysql DA under win
Hi all! My nme is Filippo, I'm a very big newbie of zope and python. Also my english is some kind of newbie stuff. But please listen to me. The box is a win nt 2000 I have installed: Zope 2.4.1; MySQL server 2.23.39; Python 2.11; after I tryed two ways: 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 with this I get this error after zope restart (there is the image of a brokenproduct: zmysqlda): Import Traceback Traceback (most recent call last): File "C:\PROGRA~1\Zope\lib\python\OFS\Application.py", line 558, in import_product product=__import__(pname, global_dict, global_dict, silly) File "C:\PROGRA~1\zope\lib\python\Products\ZMySQLDA\__init__.py", line 91, in ? import DA File "C:\PROGRA~1\zope\lib\python\Products\ZMySQLDA\DA.py", line 92, in ? from db import DB File "C:\PROGRA~1\zope\lib\python\Products\ZMySQLDA\db.py", line 89, in ? import _mysql ImportError: No module named _mysql I think that this kind of problems are for the incorrect use of c:\python211 instead of c:\zope\bin but how can I tell to the installer of the two products (mysql-python and egenix) to use the zope bin dir? The only choice possible where c:\python211 So I tried another way: 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'm really hopeless... what steps should I take? Where I'm wrong ? All this stuff goes great at my linux box at home but on windows I get all this errors. Please help me, I don't know where to look :-( I promise to write an howto in italian when all is ok :-) Thanks in advance! Filippo
Hello Fillipo, The problem here, I think is that your python cannot locate the _mysql module, you will need to put this to your python path so that when you open the python interpreter, and type
import _mysql import MySQLdb
you shouldn't get any traceback errors You should not need to have the distutils as python2.11 comes prebuild with that as standard. So long as your python can talk to mysql then zmysqlda shouldn't have any problems. hth Norman -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of f.stefanelli Sent: 18 September 2001 00:06 To: zope@zope.org Subject: [Zope] Disappointment with mysql DA under win Hi all! My nme is Filippo, I'm a very big newbie of zope and python. Also my english is some kind of newbie stuff. But please listen to me. The box is a win nt 2000 I have installed: Zope 2.4.1; MySQL server 2.23.39; Python 2.11; after I tryed two ways: 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 with this I get this error after zope restart (there is the image of a brokenproduct: zmysqlda): Import Traceback Traceback (most recent call last): File "C:\PROGRA~1\Zope\lib\python\OFS\Application.py", line 558, in import_product product=__import__(pname, global_dict, global_dict, silly) File "C:\PROGRA~1\zope\lib\python\Products\ZMySQLDA\__init__.py", line 91, in ? import DA File "C:\PROGRA~1\zope\lib\python\Products\ZMySQLDA\DA.py", line 92, in ? from db import DB File "C:\PROGRA~1\zope\lib\python\Products\ZMySQLDA\db.py", line 89, in ? import _mysql ImportError: No module named _mysql I think that this kind of problems are for the incorrect use of c:\python211 instead of c:\zope\bin but how can I tell to the installer of the two products (mysql-python and egenix) to use the zope bin dir? The only choice possible where c:\python211 So I tried another way: 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'm really hopeless... what steps should I take? Where I'm wrong ? All this stuff goes great at my linux box at home but on windows I get all this errors. Please help me, I don't know where to look :-( I promise to write an howto in italian when all is ok :-) Thanks in advance! Filippo _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
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.
cl.exe is the MSVC++ compiler, which I believe setup.py tries to use on Windows. If you don't have VC++, you don't have cl.exe :S Andy Dustman wrote:
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.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
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.
Thanks a lot, with this worked fine. Bye Filippo.
participants (4)
-
Andy Dustman -
f.stefanelli -
Harry Wilkinson -
Norman Khine