[wingide-users] Can't get Wing IDE to work with Zope3

Roger Erens roger.erens at e-s-c.biz
Mon Jan 12 17:12:36 MST 2009


Hi,

do you have some updated instructions available for using Wing IDE with 
a Zope3 instance that was created in a buildout process (in my case, 
Grok is being used)?

I reported some problem to Martijn Pieters, author of z3wingdbg (whose 
version 0.2.0 is still considered alpha) but he has no time/resources to 
delve deeper into it.

See the two messages below:

1)
on 9-1-2009 16:18 mj at zopatista.com wrote:
 > On 9. jan.. 2009, at 15.30, Roger Erens wrote:
 >> Could you please update the installation instructions when setting 
up Zope (actually, I'm using Grok) via zc.buildout?
 >>
 >> Specifically, would
 >> python setup.py install --home=/path/to/instance
 >> become something like
 >> python setup.py install --home=<project>/parts/app
 >> ?
 >>
 >> You also advice to copy z3wingdbg-include.zcml file into my
 >> Zope3 instance's etc/package-includes directory
 >>
 >> but buildout does not seem to create such a directory. Do you know 
which directory the file has to be copied to nowadays?
 >>
 >> Maybe this is of general interest, too?
 >
 > It would be, but I haven't used Wing, let alone z3wingdbg in quite a 
while.
 >
 > Anywho, you shouldn't use setup.py in this way in buildout. Just add 
z3wingdbg as an egg to your buildout and add it to the zcml line too. 
That's all that's required to have buildout find it on pypi, install it, 
and have the zope2instance recipe add z3wingdbg to the correct place.
 >
 > Martijn Pieters
 >

Hi Martijn,

I still cannot get it to work. Could you have a look into this? 
Something to do with a missing twisted.internet.interfaces module...

Here's what I did:
1) create virtual environment on Ubuntu 8.10 using python2.5:
virtualenv zenv

2) activate the virtualenv:
cd zenv; source bin/activate

3) get the zopeproject:
(zenv)easy_install zopeproject

4) use zopeproject to create a zope instance:
(zenv)zopeproject zz

5) add z3wingdbg as an egg to my buildout:
(zenv)cd zz; vi buildout.cfg

to make it look like this:
[buildout]
develop = .
parts = app test
find-links = http://download.zope.org/distribution/
newest = false
# eggs will be installed in the default buildout location
# (see ~/.buildout/default.cfg)

[app]
recipe = zc.recipe.egg
eggs = zz
        zope.app.apidoc
        zope.app.securitypolicy
        z3c.evalexception>=2.0
        Paste
        PasteScript
        PasteDeploy
        z3wingdbg
interpreter = python

[test]
recipe = zc.recipe.testrunner
eggs = zz
defaults = ['--tests-pattern', '^f?tests$', '-v']

6) add z3wingdbg to the zcml file:
(zenv)vi site.zcml

to make it look like this:
<configure xmlns="http://namespaces.zope.org/zope"
            i18n_domain="zz">

   <include package="zz" />

   <!-- Remove this reference to disable the APIDoc tool.
        You should do this for production -->
   <include file="apidoc.zcml" />

   <include package="z3wingdbg" />

   <include package="zope.app.securitypolicy" file="meta.zcml" />
   <include package="zope.app.securitypolicy" />
   <securityPolicy
       component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />

   <unauthenticatedPrincipal id="zope.anybody"
                             title="Unauthenticated User" />
   <unauthenticatedGroup id="zope.Anybody"
                         title="Unauthenticated Users" />
   <authenticatedGroup id="zope.Authenticated"
                       title="Authenticated Users" />
   <everybodyGroup id="zope.Everybody"
                   title="All Users" />

   <!-- Initial administrator account.  Disable this for production -->
   <principal id="zope.manager"
              title="Manager"
              login="admin"
              password_manager="Plain Text"
              password="admin"
              />

   <!-- Replace the following directive if you don't want public access -->
   <grant permission="zope.View"
          principal="zope.Anybody" />
   <grant permission="zope.app.dublincore.view"
          principal="zope.Anybody" />

   <role id="zope.Manager" title="Site Manager" />
   <role id="zope.Member" title="Site Member" />
   <grantAll role="zope.Manager" />
   <grant role="zope.Manager"
          principal="zope.manager" />

</configure>

6) rerun buildout:
(zenv)bin/buildout

7) try to start up the zope instance:
(zenv)bin/paster serve deploy.ini

which gives the following traceback:
------
2009-01-12T14:32:31 WARNING root Developer mode is enabled: this is a 
security risk and should NOT be enabled on production servers. Developer 
mode can be turned off in etc/zope.conf
Traceback (most recent call last):
   File "bin/paster", line 109, in <module>
     paste.script.command.run()
   File 
"/home/roger/.buildout/eggs/PasteScript-1.6.2-py2.5.egg/paste/script/command.py", 
line 79, in run
     invoke(command, command_name, options, args[1:])
   File 
"/home/roger/.buildout/eggs/PasteScript-1.6.2-py2.5.egg/paste/script/command.py", 
line 118, in invoke
     exit_code = runner.run(args)
   File 
"/home/roger/.buildout/eggs/PasteScript-1.6.2-py2.5.egg/paste/script/command.py", 
line 213, in run
     result = self.command()
   File 
"/home/roger/.buildout/eggs/PasteScript-1.6.2-py2.5.egg/paste/script/serve.py", 
line 252, in command
     relative_to=base, global_conf=vars)
   File 
"/home/roger/.buildout/eggs/PasteScript-1.6.2-py2.5.egg/paste/script/serve.py", 
line 275, in loadapp
     **kw)
   File 
"/home/roger/.buildout/eggs/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py", 
line 193, in loadapp
     return loadobj(APP, uri, name=name, **kw)
   File 
"/home/roger/.buildout/eggs/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py", 
line 214, in loadobj
     return context.create()
   File 
"/home/roger/.buildout/eggs/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py", 
line 606, in create
     return self.object_type.invoke(self)
   File 
"/home/roger/.buildout/eggs/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py", 
line 99, in invoke
     return fix_call(context.object, context.global_conf, 
**context.local_conf)
   File 
"/home/roger/.buildout/eggs/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/util/fixtypeerror.py", 
line 57, in fix_call
     val = callable(*args, **kw)
   File "/home/roger/zenv/zz/src/zz/startup.py", line 10, in 
application_factory
     return zope.app.wsgi.getWSGIApplication(zope_conf)
   File 
"/home/roger/.buildout/eggs/zope.app.wsgi-3.4.1-py2.5.egg/zope/app/wsgi/__init__.py", 
line 134, in getWSGIApplication
     db = config(configfile, schemafile, features)
   File 
"/home/roger/.buildout/eggs/zope.app.wsgi-3.4.1-py2.5.egg/zope/app/wsgi/__init__.py", 
line 124, in config
     appsetup.config(options.site_definition, features=features)
   File 
"/home/roger/.buildout/eggs/zope.app.appsetup-3.4.1-py2.5.egg/zope/app/appsetup/appsetup.py", 
line 111, in config
     context = xmlconfig.file(file, context=context, execute=execute)
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py", 
line 610, in file
     include(context, name, package)
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py", 
line 546, in include
     processxmlfile(f, context)
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py", 
line 378, in processxmlfile
     parser.parse(src)
   File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse
     xmlreader.IncrementalParser.parse(self, source)
   File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse
     self.feed(buffer)
   File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed
     self._parser.Parse(data, isFinal)
   File "/usr/lib/python2.5/xml/sax/expatreader.py", line 349, in 
end_element_ns
     self._cont_handler.endElementNS(pair, None)
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py", 
line 357, in endElementNS
     self.context.end()
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", 
line 542, in end
     self.stack.pop().finish()
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", 
line 690, in finish
     actions = self.handler(context, **args)
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py", 
line 546, in include
     processxmlfile(f, context)
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py", 
line 378, in processxmlfile
     parser.parse(src)
   File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse
     xmlreader.IncrementalParser.parse(self, source)
   File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse
     self.feed(buffer)
   File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed
     self._parser.Parse(data, isFinal)
   File "/usr/lib/python2.5/xml/sax/expatreader.py", line 349, in 
end_element_ns
     self._cont_handler.endElementNS(pair, None)
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py", 
line 357, in endElementNS
     self.context.end()
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", 
line 542, in end
     self.stack.pop().finish()
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", 
line 690, in finish
     actions = self.handler(context, **args)
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py", 
line 546, in include
     processxmlfile(f, context)
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py", 
line 378, in processxmlfile
     parser.parse(src)
   File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse
     xmlreader.IncrementalParser.parse(self, source)
   File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse
     self.feed(buffer)
   File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed
     self._parser.Parse(data, isFinal)
   File "/usr/lib/python2.5/xml/sax/expatreader.py", line 349, in 
end_element_ns
     self._cont_handler.endElementNS(pair, None)
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py", 
line 357, in endElementNS
     self.context.end()
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", 
line 542, in end
     self.stack.pop().finish()
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", 
line 689, in finish
     args = toargs(context, *self.argdata)
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", 
line 1381, in toargs
     args[str(name)] = field.fromUnicode(s)
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/fields.py", 
line 139, in fromUnicode
     value = self.context.resolve(name)
   File 
"/home/roger/.buildout/eggs/zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", 
line 182, in resolve
     mod = __import__(mname, *_import_chickens)
   File 
"/home/roger/.buildout/eggs/z3wingdbg-0.2.0-py2.5.egg/z3wingdbg/debugger/twistedmainloop.py", 
line 6, in <module>
     from twisted.internet.interfaces import IReadDescriptor
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File 
"/home/roger/zenv/zz/site.zcml", line 10.2-10.33
     ZopeXMLConfigurationError: File 
"/home/roger/.buildout/eggs/z3wingdbg-0.2.0-py2.5.egg/z3wingdbg/configure.zcml", 
line 51.0-51.30
     ZopeXMLConfigurationError: File 
"/home/roger/.buildout/eggs/z3wingdbg-0.2.0-py2.5.egg/z3wingdbg/debugger/configure.zcml", 
line 20.0-23.6
     ImportError: No module named twisted.internet.interfaces








2)
And Martijn's answer to that:

On 12. jan.. 2009, at 14.42, Roger Erens wrote:
 >> I still cannot get it to work. Could you have a look into this? 
Something to do with a missing twisted.internet.interfaces module...

Uhoh, that means things in Zope have changed and there is no longer an 
underlying twisted-based server, or you are not using the twisted-based 
server at all. This requires more extensive work to fix, something I do 
not have time for right now. :-(

 >  File 
"/home/roger/.buildout/eggs/z3wingdbg-0.2.0-py2.5.egg/z3wingdbg/debugger/twistedmainloop.py", 
line 6, in <module>
 >    from twisted.internet.interfaces import IReadDescriptor

z3wingdbg creates a separate twisted server counting on Zope already 
running under a twisted main loop. If you are running under WSGI then 
this assumption is incorrect, and z3wingdbg can't help you.

Martijn Pieters


More information about the wingide-users mailing list