This is really baffling: I cannot seem to get ZMySQLDA to work on Redhat 9. Here's what is installed: (Zope 2.6.1 (binary release, python 2.1, linux2-x86), python 2.1.3, linux2) MySQL-shared-compat-4.0.13-0 MySQL-server-4.0.13-0 MySQL-devel-4.0.13-0 MySQL-client-4.0.13-0 MySQL-python-0.9.2-1 /var/zope/lib/python/Products/ZMySQLDA version 2.0.8 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 Is it a path problem? Adding: PYTHONPATH=/usr/lib/python2.2/site-packages EXPORT PYTHONPATH to /var/zope/start does not seem to fix it. Nor does: PYTHONPATH=/usr/lib/python1.5/site-packages EXPORT PYTHONPATH ...which is where I can find _mysql.so as well as the MySQLdb directory. Zope appears not to run at all if I change Zope' python to 2.2, which came with RH9, so I am using the default python that came with the Zope binary. Getting MySQL and Zope to talk on Linux used to be so easy. What am I doing wrong? Any help would be greatly appreciated. Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
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
Hi Josh-- thanks-- exactly the conculsion I came to-- but for some reason MySQL-python would not build or install (using Zope's built in Python as you suggest)-- with an error pointing to a missing zlib- devel. I went to Redhat-- got and installed that zlib-devel RPM-- then MySQL-Python built and installed cleanly. Then the ZMySQLDA product installed without a hitch. What a relief. I was getting worried there for a moment. RH9 has been trying. Thanks for your response! Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
On Fri, 2003-08-22 at 18:56, hpinson@indepthl.com wrote:
This is really baffling:
Until somebody points out the obvious ;^) You have installed mysql-python for the "installed" python, and not for the python that was bundled with your zope. So first I'd install mysql-python from source, using the python binary that came with zope. Then, test that install by doing this: python import _mysql Should not have errors, if it does, then you never got mysql_python installed where zope can see it. Also, I saw that in order to get ZMySQLDA working you gotta change one line where the transaction-handling parameters were borked. The line (#183?): self.transactions = self.db.server_capabilities & CLIENT.TRANSACTIONS Can be changed to: self.transactions = 0 Of course, on that one I am simply monkey see, monkey do. YMMV. -- Mitch
On 08/22/2003 6:56 PM, hpinson@indepthl.com wrote:
Here's what is installed:
(Zope 2.6.1 (binary release, python 2.1, linux2-x86), python 2.1.3, linux2)
MySQL-python-0.9.2-1
How did you install MySQL-python-0.9.2? It must be compiled with the version of Python you're running Zope under and must be in a lib directory where that Python can find it. On RH9, I'm using the source version of Zope, the binary RPMs for Python 2.1.3 (available at python.org -- installed happily along side the Python that comes with RH9), and I built the MySQL-python RPMs from the tarball with something like this: # python2.1 setup.py bdist_rpm --python=python2.1 This will build with python2.1 and the RPM will install under /usr/lib/python2.1. I've never used the binary version of Zope, so I don't really know where things need to go if you're going to use that.
Getting MySQL and Zope to talk on Linux used to be so easy. What am I doing wrong?
It's still easy... if you know what to do. ;-) -- Ron Bickers Logic Etc, Inc.
participants (4)
-
hpinson@indepthl.com -
Josh Trutwin -
Mitch Pirtle -
Ron Bickers