Problem with CGI Script

Hello,

I had to move our company's intranet to a new machine running Centos 5. Whenever cgi scripts now execute I find this error message in the logs:

Mon Oct 05 11:19:39 2009] [error] [client 205.150.86.90] Premature end of script headers: vacation.cgi, referer: https:/{URL}]
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback

One solution was to make sure the scripts prints headers but the script already does:

print "Content-type: text/html\n";
print "Location: $WEBROOT/forms/confirm.html\n\n";

Anyone have any idea what needs to be done?

Maybe I have to install some packages?