Hi everyone, I guess I'm back to asking simple questions. I've got an application running (finally) but it all resides in one big module called Externals.py that resides in c:\program files\website\Externals. I've gotten to the point where I need to separate the function into various modules but since I'm still a newbie, I've been having trouble doing it. I tried moving one simple class to a separate module called BarsDB. I then added a line "import BarsDB" to the top of the Externals.py module. I'm using Visual Python as my editor/debugger. Everything works fine from there but when I try to reload my external method (Externals.py), I get this error message; ImportError: No module named BarsDB Where do you define the Pythonpath for Zope? I know there's some funky stuff about the way Zope handles external modules. I don't really understand it and I think that's why I'm having trouble figuring this one out. Can anyone shed some light?
Joe Goldthwaite wrote at 2004-2-23 14:58 -0700:
... Where do you define the Pythonpath for Zope?
In the environment variable "PYTHONPATH" (from Zope 2.7 on, you can extend it (sometimes) from the configuration file).
I know there's some funky stuff about the way Zope handles external modules.
There is not special treatmend for (normal) modules. There are funky stuff for "External Methods" but apparently we do not speak about them...
I don't really understand it and I think that's why I'm having trouble figuring this one out.
The primary source of the python path is the environment variable PYTHONPATH (on windows, it can be determined by a registry entry). Zope extends it a bit (to find its infrastructure). Python extends it a bit (to find its runtime library. Your application can further extend it a bit. You can see the effective Python path in "Control_Panel --> Debug information". Watch out for "sys.path". -- Dieter
participants (2)
-
Dieter Maurer -
Joe Goldthwaite