[Pythonmac-SIG] Python on OS X
Tracy Ruggles
trace@reinventnow.com
Sun, 9 Dec 2001 16:35:51 -0600
Below is the traceback with '-v' option on...
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; traceback:
ImportError: No module named site
Python 2.1 (#4, 05/17/01, 18:34:21)
[GCC Apple DevKit-based CPP 6.0alpha] on darwin1
Type "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/Library/WebServer/CGI-Executables/test.py", line 3, in ?
import string
ImportError: No module named string
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] signal
# cleanup[1] exceptions
# cleanup sys
# cleanup __builtin__
# cleanup ints: 1 unfreed int in 1 out of 1 block
# cleanup floats
[Sun Dec 9 16:34:01 2001] [error] [client 127.0.0.1] Premature end of
script headers: /Library/WebServer/CGI-Executables/test.py
On Sunday, December 9, 2001, at 04:24 PM, Tony Lownds wrote:
> Hi Tracy,
>
> Can you try changing the first line of your script to
>
> #!/usr/local/bin/python -v
>
> That will cause Python to output details about it's importing process.
>
> -Tony
>
>
> At 4:11 PM -0600 12/9/01, Tracy Ruggles wrote:
>> Hi,
>>
>> I've been able to install Python on OS X with the pre-compiled version
>> and can use it interactively via the Terminal, but when I try to call it
>> from a CGI, I get a message I haven't seen before:
>>
>>> 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
>>> Traceback (most recent call last):
>>> File "/Library/WebServer/CGI-Executables/test.py", line 5, in ?
>>> import string
>>> ImportError: No module named string
>>> [Sun Dec 9 16:10:47 2001] [error] [client 127.0.0.1] Premature end of
>>> script headers: /Library/WebServer/CGI-Executables/test.py
>>
>> The first 4 lines of this error message happen every time. The module,
>> 'string', doesn't seem to want to load. 'sys' and 'os' are there, but I
>> haven't tested for other ones.
>>
>> The code calling it is:
>>
>>> #!/usr/local/bin/python
>>>
>>> import string
>>> print "Content-type: text/html\n\n"
>>> print dir(string)
>>
>> Does anybody have any idea what's happening?
>>
>> Thanks,
>> Tracy
>>
>>
>> --
>> tracy s. ruggles -- trace@reinventnow.com
>>
>>
>> _______________________________________________
>> Pythonmac-SIG maillist - Pythonmac-SIG@python.org
>> http://mail.python.org/mailman/listinfo/pythonmac-sig
>
>
> --