CGI script refuses to run python

Sheila King sheila at spamcop.net
Thu Apr 5 19:02:54 EDT 2001


On Thu, 5 Apr 2001 15:46:25 -0700, "vikas" <viznogoud at yahoo.com> wrote in
comp.lang.python in article <tcpt6vsugf6b62 at corp.supernews.com>:

:Ok, I have the same error.
:However, my sys.path has the correct paths in it.
:i.e. python is installed in /usr/local/lib/python2.0.
:
:I tried making shell scripts to set the env
:and then try to invoke python. It seems like if
:I set the PYTHONPATH before invoking python,
:it works. But any python scripts invoked by that
:python scripts don't work!
:
:Any ideas?
:

It really doesn't sound to me, like you have it installed in the right place.
If you did, surely it would be able to find everything it needs for the
scripts to run??? Is the binary in /usr/local/lib also? Usually it should be
in /usr/local/bin I believe.

Run a script similar to this one (This one is a cgi-script, meant to be
invoked from a browser, but it should run at the command line, too):

------------------------------------------
#! /usr/local/bin/python2.0

import sys
print "Content-type: text/plain\n\n"

print sys.version
print

for path in sys.path:
	print path

print
print "Those are the paths"
------------------------------------------

That will show what the path actually are. If you do not have the binary
installed where it expects, and the libraries installed where it expects, I'd
think you'd be having problems.

The work-around that I had, before I re-installed, was to reset the paths
inside of each script right at the beginning of the script, to point to the
directories where the binary and the libraries were installed.

--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/


:Sheila King <sheila at spamcop.net> wrote in message
:news:hhanctghter75fs890kk98ttmue18pi2p2 at 4ax.com...
:> Try this URL:
:>
:> http://www.aota.net/ubb/Forum3/HTML/001564-1.html
:>
:> --
:> Sheila King
:> http://www.thinkspot.net/sheila/
:> http://www.k12groups.org/
:>
:>
:> On Wed, 4 Apr 2001 14:53:46 -0700, "vikas" <viznogoud at yahoo.com> wrote in
:> comp.lang.python in article <tcn5o76ljn8sc3 at corp.supernews.com>:
:>
:> :Hi,
:> :I am trying to get this python cgi script to work on apache.
:> :I made a test script to break down the problem.
:> :
:> :So now the script is just:
:> :#!/usr/local/bin/python
:> :
:> :I still get the same error in the web server log:
:> :
:> :Could not find platform independant libraries <prefix>
:> :Could not find platform dependant libraries <exec_prefix>
:> :Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
:> :'import site' failed; use -v for traceback
:> :
:> :How do I fix this?
:> :
:> :Thanx
:> :Vikas
:> :
:>
:




More information about the Python-list mailing list