[Tutor] can't find module running on apache

Daniel Yoo dyoo@hkn.eecs.berkeley.edu
Tue, 24 Apr 2001 19:45:19 -0700 (PDT)


On Tue, 24 Apr 2001, Suzanne Little wrote:

>     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.

Can you verify that Python1.52 isn't being run?  Since you mentioned
Python 2.0, it could be possible that Apache might be using the wrong
Python version.

You can check this with a quick script:

###
import sys
print "content-type: text/plain\n\n"
print sys.version
###

which should tell us if that's the problem.

Good luck to you!