Grok will not launch with win32 installed

Bug #759971 reported by Mats
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grok
New
Undecided
Unassigned

Bug Description

When Mark Hammond's win32 extension is installed, grok fails to launch with the following error. If I uninstall win32 it launches just fine.

Traceback (most recent call last):
  File "C:\Projects\iport\bin\paster-script.py", line 20, in <module>
    paste.script.command.run()
  File "c:\python27\lib\site-packages\pastescript-1.7.3-py2.7.egg\paste\script\command.py", line 84, in run
    invoke(command, command_name, options, args[1:])
  File "c:\python27\lib\site-packages\pastescript-1.7.3-py2.7.egg\paste\script\command.py", line 123, in invoke
    exit_code = runner.run(args)
  File "c:\python27\lib\site-packages\pastescript-1.7.3-py2.7.egg\paste\script\command.py", line 218, in run
    result = self.command()
  File "c:\python27\lib\site-packages\pastescript-1.7.3-py2.7.egg\paste\script\serve.py", line 276, in command
    relative_to=base, global_conf=vars)
  File "c:\python27\lib\site-packages\pastescript-1.7.3-py2.7.egg\paste\script\serve.py", line 313, in loadapp
    **kw)
  File "c:\python27\lib\site-packages\pastedeploy-1.3.4-py2.7.egg\paste\deploy\loadwsgi.py", line 203, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "c:\python27\lib\site-packages\pastedeploy-1.3.4-py2.7.egg\paste\deploy\loadwsgi.py", line 224, in loadobj
    return context.create()
  File "c:\python27\lib\site-packages\pastedeploy-1.3.4-py2.7.egg\paste\deploy\loadwsgi.py", line 617, in create
    return self.object_type.invoke(self)
  File "c:\python27\lib\site-packages\pastedeploy-1.3.4-py2.7.egg\paste\deploy\loadwsgi.py", line 163, in invoke
    app = context.app_context.create()
  File "c:\python27\lib\site-packages\pastedeploy-1.3.4-py2.7.egg\paste\deploy\loadwsgi.py", line 617, in create
    return self.object_type.invoke(self)
  File "c:\python27\lib\site-packages\pastedeploy-1.3.4-py2.7.egg\paste\deploy\loadwsgi.py", line 109, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "c:\python27\lib\site-packages\pastedeploy-1.3.4-py2.7.egg\paste\deploy\util\fixtypeerror.py", line 57, in fix_call
    val = callable(*args, **kw)
  File "c:\users\mats.ims\.buildout\eggs\grokcore.startup-1.1-py2.7.egg\grokcore\startup\startup.py", line 19, in debug_application_factory
    app = application_factory(global_conf, **local_conf)
  File "c:\users\mats.ims\.buildout\eggs\grokcore.startup-1.1-py2.7.egg\grokcore\startup\startup.py", line 14, in application_factory
    return zope.app.wsgi.getWSGIApplication(zope_conf)
  File "c:\users\mats.ims\.buildout\eggs\zope.app.wsgi-3.13.0-py2.7.egg\zope\app\wsgi\__init__.py", line 162, in getWSGIApplication
    db = config(configfile, schemafile, features)
  File "c:\users\mats.ims\.buildout\eggs\zope.app.wsgi-3.13.0-py2.7.egg\zope\app\wsgi\__init__.py", line 150, in config
    appsetup.config(options.site_definition, features=features)
  File "c:\users\mats.ims\.buildout\eggs\zope.app.appsetup-3.15.0-py2.7.egg\zope\app\appsetup\appsetup.py", line 111, in config
    context = xmlconfig.file(file, context=context, execute=execute)
  File "c:\users\mats.ims\.buildout\eggs\zope.configuration-3.7.4-py2.7.egg\zope\configuration\xmlconfig.py", line 649, in file
    include(context, name, package)
  File "c:\users\mats.ims\.buildout\eggs\zope.configuration-3.7.4-py2.7.egg\zope\configuration\xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "c:\users\mats.ims\.buildout\eggs\zope.configuration-3.7.4-py2.7.egg\zope\configuration\xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "C:\Python27\lib\xml\sax\expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "C:\Python27\lib\xml\sax\xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "C:\Python27\lib\xml\sax\expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "C:\Python27\lib\xml\sax\expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "c:\users\mats.ims\.buildout\eggs\zope.configuration-3.7.4-py2.7.egg\zope\configuration\xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "c:\users\mats.ims\.buildout\eggs\zope.configuration-3.7.4-py2.7.egg\zope\configuration\config.py", line 558, in end
    self.stack.pop().finish()
  File "c:\users\mats.ims\.buildout\eggs\zope.configuration-3.7.4-py2.7.egg\zope\configuration\config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "c:\users\mats.ims\.buildout\eggs\zope.configuration-3.7.4-py2.7.egg\zope\configuration\xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "c:\users\mats.ims\.buildout\eggs\zope.configuration-3.7.4-py2.7.egg\zope\configuration\xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "C:\Python27\lib\xml\sax\expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "C:\Python27\lib\xml\sax\xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "C:\Python27\lib\xml\sax\expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "C:\Python27\lib\xml\sax\expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "c:\users\mats.ims\.buildout\eggs\zope.configuration-3.7.4-py2.7.egg\zope\configuration\xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "c:\users\mats.ims\.buildout\eggs\zope.configuration-3.7.4-py2.7.egg\zope\configuration\config.py", line 558, in end
    self.stack.pop().finish()
  File "c:\users\mats.ims\.buildout\eggs\zope.configuration-3.7.4-py2.7.egg\zope\configuration\config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "c:\users\mats.ims\.buildout\eggs\z3c.autoinclude-0.3.3-py2.7.egg\z3c\autoinclude\zcml.py", line 51, in includeDependenciesDirective
    info = DependencyFinder(dist).includableInfo(['configure.zcml', 'meta.zcml'])
  File "c:\users\mats.ims\.buildout\eggs\z3c.autoinclude-0.3.3-py2.7.egg\z3c\autoinclude\dependency.py", line 24, in includableInfo
    module = resolve(dotted_name)
  File "c:\users\mats.ims\.buildout\eggs\zope.dottedname-3.4.6-py2.7.egg\zope\dottedname\resolve.py", line 32, in resolve
    found = __import__(used)
  File "c:\python27\lib\site-packages\win32com\__init__.py", line 5, in <module>
    import win32api, sys, os
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "C:\Projects\iport\parts\etc\site.zcml", line 4.2-4.29
    ZopeXMLConfigurationError: File "c:\projects\iport\src\iport\configure.zcml", line 4.2-4.37
    ImportError: No module named win32api

Revision history for this message
Matthias (nitrogenycs) wrote :

This traceback actually means win32api is *not* installed. You'll have to do it by hand maybe.

Revision history for this message
Mats (mats-nordgren) wrote :

No this traceback is with win32 installed. When it is not installed grok launches fine.

Revision history for this message
Mats (mats-nordgren) wrote :

I just uninstalled win32 and launched grok.

serving on http://127.0.01:8080

Reinstalled win32 again.

ImportError: No module named win32api

Revision history for this message
Jan-Jaap Driessen (janjaapdriessen) wrote :

Mats, the error you encounter is a result of z3c.autoinclude going through your sys.path.

If you install grok inside a virtualenv this error will go away.

We (the grok people) need to come up with a solution for this.

Revision history for this message
Mats (mats-nordgren) wrote :

Jan,

That would explain it. I was getting excited not having to use virtualenv anymore but it appears I will have to use it a bit longer.

Thanks

Revision history for this message
Jan-Jaap Driessen (janjaapdriessen) wrote :

Mats,

You can use grok without virtualenv if you stop using z3c.autoinclude. It's as simple as removing the line `<includeDependencies package=".">` from the configure.zcml of your project. The downside is that you have to configure the packages you depend on manually.

I read on zope-dev that `cykooz` is working on z3c.autoinclude. Maybe his changes fix your problem.

Cheers,

JJ

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.