Hi, 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. Any hint ? Where should I put this ? TIA --Gilles
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
participants (2)
-
Dieter Maurer -
Gilles Lenfant