[Tutor] [OT] MySQLdb on Redhat 9

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Fri Jul 25 19:05:02 2003


On Fri, 25 Jul 2003 tpc@csua.berkeley.edu wrote:

> hello, I was wondering if anyone has tried to install MySQLdb on Redhat
> Linux 9.  I just installed the module and it was fine:
>
> [root@nike download]# rpm -ivh MySQL-python-0.9.2-1.i386.rpm
> warning: MySQL-python-0.9.2-1.i386.rpm: V3 DSA signature: NOKEY, key ID
> 930b8ab6
> Preparing...                ###########################################
> [100%]
>    1:MySQL-python           ###########################################
> [100%]
>
> though now when I try to run a python script that imports MySQLdb it
> says "ImportError: No module named MySQLdb".


Hi tpc,

Let's check something really quickly: are you using the standard Python
that comes with Red Hat, or a locally-installed version?  Check with:

    $ which python

at your shell prompt and tell us what you get.


In the same vein, try:

    $ /usr/bin/python

and from there, see if you can do 'import MySQLdb' --- this should be
successful.

If you're using a locally installed Python, then you probably need to
install the MySQLdb module from the source, since the RPM packages are
designed to work only with the Python that comes in the Red Hat
distribution.


This might not be the cause of the problem, but it's highly likely.
*grin*  Good luck to you!