Mailing List Archive

CGI ImportError
I am using the BSCW software on a S.u.S.E 5.3 Linux server and every time
I try to use one of the python scripts I get the following error in the
apache error log.

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import exceptions' failed; use -v for traceback
Warning! Falling back to string-based exceptions
'import site' failed; use -v for traceback
Traceback (innermost last):
File "wrapped", line 2, in ?
import os, sys
ImportError: No module named os
[Mon Jul 26 09:23:49 1999] [error] Premature end of script headers:
/BSCW3/BSCW

I thought that there was some thing wrong with os and sys so I wrote and
successfully compiled the following program.

#!/usr/bin/python
import os, sys
print 'test'

I have never used python before so this test program might not be worth
a whole lot but it seems to be importing os and sys without any
difficulty.

My python directory is Python-1.5.2 on the / directory.
There is a soft link in the /usr/bin directory.
Python is in the path.
I downloaded the lot form the www.python.org web site.
CGI ImportError [ In reply to ]
>Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]

You could modify the environment of the web server to
include and pass on (mod_env?) PYTHONHOME=/Python-1.5.2.
You should verify that the server (with uid "nobody")
has permissions to read $PYTHONHOME.

What may be simpler is to re-build python and
leave the default paths unchanged.

Hope this helps,
Ed
--

Edward F. McCurdy, | ed@sis.yorku.ca
York University, Toronto, Canada | (416) 736-2100x22685