[Zope] Importing from
Dieter Maurer
dieter@handshake.de
Sat, 11 Aug 2001 00:07:06 +0200 (CEST)
Gilles Lenfant writes:
> I got some scripts in $ZOPEROOT/Extensions. One of them (GlobalDefs.py)
> contains definitions for other modules.
> I got an ImportError when accessing this module with "import GlobalDefs"
> from other modules (that are used from Zope)
> Thought that the dir of a main module is always in the import path.
Zope imports the files in "Extensions" in a special (obscure)
way. Therefore, they can not import "Extensions" files.
But them in a subpackage of "Shared" and import them from there:
from Shared.<your_package> import GlobalDefs
Dieter