ImportError: cannot import name Persistent
One of my Python Products is not working. It fails with the above error when trying to "from Globals import DTMLFile" File "/home/local/opt/Zope-2.4.3/lib/python/OFS/Application.py", line 563, in import_product product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zopeinstancehome/Products/XXX/__init__.py", line 2, in ? from XXX import XXX manage_addSNPSetForm, manage_addSNPSet File "/usr/local/zopeinstancehome/Products/XXX/XXX.py", line 11, in ? import YYY File "/usr/local/zopeinstancehome/Products/XXX/YYY.py", line 13, in ? from Globals import DTMLFile, HTMLFile, InitializeClass File "/home/local/opt/Zope-2.4.3/lib/python/Globals.py", line 95, in ? from Persistence import Persistent, PersistentMapping ImportError: cannot import name Persistent Other products which do exactly the same thing are working fine. This product was also working earlier today. I've tried the "import ZODB" trick, but it doesn't help. Any ideas? Thanks, John Ziniti
You probably want: from Globals import Persistent There aren't any Python modules in the Persistence folder, which is why you can't find what you're looking for. HTH, Dylan At 02:22 PM 11/6/2002 -0500, you wrote:
from Persistence import Persistent, PersistentMapping ImportError: cannot import name Persistent
I think you misunderstand. My code does: from Globals import DTMLFile and _Globals_ is trying to import from Persistence Dylan Reinhardt wrote:
You probably want:
from Globals import Persistent
There aren't any Python modules in the Persistence folder, which is why you can't find what you're looking for.
HTH,
Dylan
At 02:22 PM 11/6/2002 -0500, you wrote:
from Persistence import Persistent, PersistentMapping ImportError: cannot import name Persistent
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Soooo stupid it almost *hurts* sometimes ... "__name__" is a *very* poor choice for a variable name. I think I've done the same thing before. :-/
At 03:01 PM 11/6/2002 -0500, you wrote:
I think you misunderstand. My code does:
from Globals import DTMLFile
and _Globals_ is trying to import from Persistence
Ah... whoops. My bad. In that case, I have no idea. Sorry.
participants (3)
-
Dylan Reinhardt -
Dylan Reinhardt -
John Ziniti