On a new RH9 linux server I am attempting to install ZMySQLDA Product and am getting this error: "No module named _mysql" Prior to install of the Product I had added the mysql-python-0.9.2- 1.i386.rpm sucessfully, per suggestions here. Any suggestions? I see reference to a FAQ but have not been able to find it. Where might that be? Here is the Zope 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 Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
You need to install the MySQL product as well as ZMySQLDA. You can fetch both from Sourceforge. There's a RH9 RPM which would probably work as well. On Fri, 22 Aug 2003 hpinson@indepthl.com wrote:
On a new RH9 linux server I am attempting to install ZMySQLDA Product and am getting this error: "No module named _mysql"
Prior to install of the Product I had added the mysql-python-0.9.2- 1.i386.rpm sucessfully, per suggestions here.
Any suggestions? I see reference to a FAQ but have not been able to find it. Where might that be?
Here is the Zope 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
Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
and am getting this error: "No module named _mysql" Prior to install of the Product I had added the mysql-python-0.9.2- 1.i386.rpm sucessfully
check out "rpm -ql MySQL-python", this package installs python modules for python1.5 while you are using probably python2.2, you have to add the path "/usr/lib/python1.5/site-packages" to your PYTHONPATH, then you'll get a warning about C API version mismatch each time you "import MySQLdb" (or CompatMysqldb), but don't worry, this doesn't seem to cause any trouble in using mysql -- bromden[at]gazeta.pl
For me, the RPM did not work-- it installed, but to the wrong python (1.5), and despite my efforts to include that in the PYTHONPATH, zope would not see it. No luck at all with the 2.2 version of Python. I ended up building MySQL-python from scratch, and after resolving a library issue around zlib-devel, all is now working. Thanks to everyone for being so helpful. I do have a question-- why is ZMySQLDA not part of the Zope core? It seems a very common task to want to connect MySQL to Zope on either Linux or Windows. I gave up trying on Windows, and use the ODBC adapter instead (with MyODBC), which fortunatly, seems to work well. Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
One other point, you need to install MySQL into the python you are using for Zope. If you have a binary install, that's the python in lib/bin and probably not the usual system-level python. On Fri, 22 Aug 2003 hpinson@indepthl.com wrote:
On a new RH9 linux server I am attempting to install ZMySQLDA Product and am getting this error: "No module named _mysql"
Prior to install of the Product I had added the mysql-python-0.9.2- 1.i386.rpm sucessfully, per suggestions here.
Any suggestions? I see reference to a FAQ but have not been able to find it. Where might that be?
Here is the Zope 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
Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
hpinson@indepthl.com wrote at 2003-8-22 11:12 -0600:
On a new RH9 linux server I am attempting to install ZMySQLDA Product and am getting this error: "No module named _mysql"
Prior to install of the Product I had added the mysql-python-0.9.2- 1.i386.rpm sucessfully, per suggestions here.
Any suggestions?
Do you run a binary Zope version? Then, it does not look at the standard place for Python (and its libary) but comes with its own Python version. In this case, you must make "_mysql.so" available for Zope's Python. It usually looks for its library in "<zopedir>/lib/python*". Copy or symbolic link "_mysql.so" thereto. Dieter
participants (4)
-
bromden -
Dennis Allison -
Dieter Maurer -
hpinson@indepthl.com