[Zope] PYTHONPATH

Thomas B. Passin tpassin@mitretek.org
Tue, 19 Mar 2002 13:44:39 -0500


[Kevin Carlson]

> My bad, Thomas.  That's actually what I have in the PYTHONPATH...any other
> ideas?
>

Here's what I would do.  In Zope, create an external method that reports the
system path:

import sys
def getpath():
    return sys.path


Display the results in a  dtml page that calls the external method.  Now you
know exactly what path Zope is using.  Next, launch Python as you intend to
for your out-of-Zope development.  Get sys.path and see if any directories
are missing.  Set PYTHONPATH to add them.  If you are using Zope's Python,
set the PYTHONPATH before launching Python.

I don't know if Python as used by Zope needs to find anything in relative
paths or not, but that should be handled by cd-ing to the Zope startup
directory before launching Python.

Cheers,

Tom P