Importing MySQLdb/Changing Paths at run-time

Sam Penrose sam at ddmweb.com
Fri Sep 28 17:09:24 EDT 2001


import sys
sys.path.append('whatever')

always works for me. I'm not sure why the near-equivalent isn't working
for you.

You can also set the PYTHONPATH environment variable for the cgi user
though it sounds like this may be unworkable in your situtation. Our
httpd.conf files have a line that reads:

SetEnv PYTHONPATH /home/httpd/shared/cgi-bin





More information about the Python-list mailing list