[Tutor] Where is PYTHONPATH set?

Deirdre Saoirse deirdre@deirdre.net
Mon, 6 Nov 2000 11:26:01 -0800 (PST)

On Mon, 6 Nov 2000, Brad Chandler wrote:

> I've recently installed Python 2.0, an upgrade from 1.6.  I believe I
> also had 1.5 on the machine originally.  The systems seems to still be
> looking in /usr/lib/python1.5 for the modules, however the new version
> put them in /usr/local/lib/python2.0.

Since you're talking a web server, in the script that starts the web
server (/etc/rc.d/init.d/httpd for Red Hat Linux), put:

export PYTHONPATH=/usr/local/lib/python2.0

You may need to fuss with the path to get it right (I've never needed the
PYTHONPATH set...), but that's what to do and where. You'll need to stop
and restart your web server to test it.

(if bash isn't your default shell, you'll need to translate this into
whatever shell you're using)

> I'm trying to get cgi to work and also the postgresql integration.  
> When I try to run a cgi script I get an error in my
> apache/logs/error.log file that suggests I set $PYTHONPATH to
> something like [exec_prefix][prefix].  I don't think that's the exact
> quote but its close.  I also get a similar message when trying to
> install postgres integration (I can't remember the name of the package
> right now, it seems that there are two packages that do this, one of
> which I had working with 1.6).
> With 1.6, I ended up creating a bunch of symlinks, but I'd rather not
> do that.  How can I tell my system where to look in
> /usr/local/lib/python2.0 instead of /usr/lib/python1.5?

_Deirdre   *   http://www.sfknit.org   *   http://www.deirdre.net
"You had thesaurus flakes for breakfast again, didn't you?"
                                                 -- Eric Williams