Import Problems - What am I doing wrong?
I have two Python Products, Virtual_site and Virtual_Misc in the lib/python/Products directory.... In Virtual_Site, I have a Python module called Campus and inside it, I have a Class called Campus..... In Virtual_Misc, I have a Python module called Misc and inside it, I have a Class called Misc and several methods..... I have been trying to import the methods from Virtual_Misc.Misc into Virtual_Site.Campus - but everytime I try to import I get an error.... I have tried putting the following into the module Virtual_Site.Campus: import Misc and from Virtual_Misc import Misc and from Virtual_Misc.Misc import Misc and import Virtual_Misc.Misc.Misc None of these work and I get an error.... So I tried to put the import statement into __init__.py - again no luck..... This is very frustrating to me and obviously I am missing something - IF someone out there can enlighten me, I would greatly appreciate it... TIA WPH
Bill Hewitt wrote at 2004-9-10 19:45 -0700:
I have two Python Products, Virtual_site and Virtual_Misc in the lib/python/Products directory....
In Virtual_Site, I have a Python module called Campus and inside it, I have a Class called Campus.....
In Virtual_Misc, I have a Python module called Misc and inside it, I have a Class called Misc and several methods.....
I have been trying to import the methods from Virtual_Misc.Misc into Virtual_Site.Campus - but everytime I try to import I get an error....
Which one? How do you import? I do this routinely: from Products.MyProduct.MyModule import MyClass It works fine. -- Dieter
participants (2)
-
Bill Hewitt -
Dieter Maurer