[Zope] RE: Importing Products into my Custom Product....

Paul Winkler pw_lists at slinkp.com
Sat Sep 11 16:08:59 EDT 2004


On Sat, Sep 11, 2004 at 12:54:46PM -0700, Dave Kuhlman wrote:
> You might print or inspect the contents of sys.path.  For example:
> 
>     import sys
>     print sys.path
> 
> sys.path is a list of the places you can import things from.  Then,
> if the path you need is not there, do the following before
> importing:
> 
>     sys.path.append("/a/path/to/the/instance/Products")
> 
> or:
> 
>     sys.path.insert(0, "/a/path/to/the/instance/Products")

You should never need to do that.
In Zope 2.7, if you really need to add additional directories
to your Products path, you can set the "products"
directive in etc/zope.conf, multiple times if needed:

# Example:
#
#    products /home/chrism/projects/myproducts

But anyway, based on the original post, it is not a problem
with the path. Zope is reporting import errors when trying to
import one of his Products, and both are in the same Products
directory, so his path is fine. It's got to be a problem with 
his code.

-- 

Paul Winkler
http://www.slinkp.com


More information about the Zope mailing list