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