MySQL and Zope products problems
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"? The description above sounds exactly like our error, but we're not sure how to proceed. As you can probably tell, we're neither Linux, Python or Zope experts in this area! Any suggestions would be much appreciated! Richard H.
On 29/1/02 8:53 am, "Richard Hewison" <richard.hewison@luton.ac.uk> wrote:
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"
ldconfig on linux helps a bit (I think - I use Solaris). Check the archives for 'ldconfig'.
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"?
It's the python that's referenced in the 'exec' line of the 'start' file. Usually /usr/local/bin/python - but can be a python bundled with a binary release of zope (in which case you'll have an unusual python path in 'start') To setup mysqldb you need to do % python setup.py build % python setup.py install (check I've got it right in the docs) 'python' above is usually /usr/local/bin/python but you must make sure you use the python from a binary release of Zope. Hth Tone -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope
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
participants (3)
-
Dieter Maurer -
Richard Hewison -
Tony McDonald