ImportError: No module name MySQLdb
bruno at modulix
onurb at xiludom.gro
Thu Jan 26 03:42:18 EST 2006
Fred wrote:
> I hope someone can help me with the below problem...
>
> Thanks,
> Fred
>
> My enviroment:
> --------------------------
> Slackware Linux 10.2
> Python 2.4.2
> MySql version 4.1.14
> MySql-Python 1.2.0
>
> What I am trying to do:
> ---------------------------
> Using MySQL, Python, My-Sql-Python module and CGI create a simple
> database that can be accesed with a webpage.
>
> Everything worked great up to this error when trying to load the
> webpage:
> "ImportError: No module name MySQLdb"
>
> Note that I do NOT get the error when running the script normally from
> Python.
So I'd say it has something to do with sys.path
Is there anything "non-standard" with your config ? Like modules
installed as a user and/or outside of /usr/lib/pythonXXX/site-packages/ ?
> I have read much but can not seem to nail the problem down, I am
> thinking a path error.
+1
add this at the beginning of your script, *before* trying to import
anything else.
import sys
print "sys.path is", sys.path
(snip code)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"
More information about the Python-list
mailing list