-----Original Message----- From: zope-request@zope.org [mailto:zope-request@zope.org] Sent: 25 February 2003 17:00 To: zope@zope.org Subject: Zope digest, Vol 1 #2620 - 40 msgs Send Zope mailing list submissions to zope@zope.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.zope.org/mailman/listinfo/zope or, via email, send a message with subject or body 'help' to zope-request@zope.org You can reach the person managing the list at zope-admin@zope.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Zope digest..." Today's Topics: 1. MySQLdb outside zope (Ed Colmar) [snip] --__--__-- Message: 1 Date: Tue, 25 Feb 2003 00:29:11 -0800 (PST) To: <zope@zope.org> From: Ed Colmar <ed@greengraphics.net> Subject: [Zope] MySQLdb outside zope Hi all... I've got the MySQLdb and ZMySQLDA all up and running on my zope install, but I can't seem to import the library form my regular python interpreter... I have not had any luck compiling it. I did install the latest rpm, but still no import in python... Even when launching the python in /usr/local/zope/bin/ it won't import... Is there some trick that I'm missing here? I'm trying to follow the devshed Mysql python tutorial... Thanks for any pointers! -ed- Here are the errors if that helps: --- system python install --- Python 2.2.1 (#1, Sep 9 2002, 09:26:21) [GCC 3.2 (Mandrake Linux 9.0 3.2-1mdk)] on linux-i386 Type "help", "copyright", "credits" or "license" for more information.
import _mysql Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named _mysql import MySQLdb Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named MySQLdb
--- zope python install --- Python 2.1.3 (#1, Sep 19 2002, 13:15:46) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 Type "copyright", "credits" or "license" for more information.
import _mysql Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named _mysql import MySQLdb Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named MySQLdb
-- Green Graphics ::: Print and Web Design ::: 510.923.0000 --__--__-- [snip] Ed, you've probably got a path issue. First note where the MySQLdb directory is installed then start up a Python interpreter (from /usr/local/zope/bin) and type;
import os print os.path
You will get a list of directories, and the chances are that the location of MySQLdb is not in the list. By the way, don't try and import _mysql that is the old name of the module and is only kept around for backwards compatibility (a.f.a.i.k). HTH, Andy