ImportError: No module name MySQLdb
Steve Holden
steve at holdenweb.com
Thu Jan 26 09:00:08 EST 2006
Fred wrote:
> Here is the complete error from my Apache error log:
>
> Traceback (most recent call last):
> File "/var/www/cgi-bin/mysqld_script_test.py", line 7, in ?
> import MySQLdb
> ImportError: No module named MySQLdb
> [Thu Jan 26 07:25:16 2006] [error] [client 127.0.0.1] malformed header
> from script. Bad header=['/var/www/cgi-bin', '/usr/lib:
> /var/www/cgi-bin/mysqld_script_test.py
>
I think you can ignore this error: it's happening because of your debug
output of syst.path, which presumably takes place before the script
prints out
"""Content-Type: text/html
"""
or similar.
If your program doesn't do that it'll likely not produce what you expect
anyway.
Finally, you might want to think about adding
import cgitb; cgitb.enable()
to your existing scripts. This will give you a much more acceptable
traceback from web conditions.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
More information about the Python-list
mailing list