[Tutor] can't find module running on apache

Suzanne Little s349929@student.uq.edu.au
Tue, 24 Apr 2001 15:54:21 +1000 (GMT+1000)


Hello,

I've got some code using the MySQLdb module that I want to put on a web
server (apache1.3.12). As far as I can tell the code is fine - that is it
works when not on the server but when I try to run it I get the following
error in my log:
Traceback (most recent call last):
  File
"/projects/rdu/apache/apache_1.3.12/cgi-bin/search.py", line
18, in ?
    import cgi, re, MySQLdb
ImportError: No module named MySQLdb
[Tue Apr 24 14:22:27 2001] [error] [client 130.102.176.124] Premature end
of script headers:
/projects/rdu/apache/apache_1.3.12/cgi-bin/search.py

Okay so it couldn't find the MySQLdb module.
>From information in 'Dave Mitchell's Python CGI FAQ' it looks like it's
some sort of path problem. So following one of the suggestions I made a
small start up script which set the environment variables to the same as
the ones in my environment (since they work) but either I didn't write the
script correctly or that's not the problem because it didn't work. I know
next to nothing about apache. I'm using Python2.0 on solaris8.

Thanks for any advice,
Suzanne :)

--------------------------------------------------------------------------
"Contrariwise," continued Tweedledee, "If it was so, it might be; and if
it were so, it would be; but as it isn't, it ain't.  That's logic"
                             -Lewis Carroll
--------------------------------------------------------------------------