[Zope3-Users] No module named formlib...

Joshua Burvill josh at mri.com.au
Wed Oct 26 02:36:37 EDT 2005


Hello All,

I am starting to work through Benji Yorks zope3 quickstart document which I
am enjoying, but I've run into one problem.

http://www.benjiyork.com/quick_start/

When I do the steps to create the edit form for hello world, I can no longer
start zope. See below for the traceback.

Any help appreciated.

It seems the problem is with the line

from zope.formlib import form

In hello.py

When I try at the interactive python prompt I get:

>>> from zope.formlib import form
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in ?
    from zope.formlib import form
ImportError: No module named formlib

hello.py:

import persistent
from zope import interface, schema
from zope.formlib import form

class IHelloWorld(interface.Interface):
    greeting = schema.TextLine()
    subject = schema.TextLine()

class HelloWorld (persistent.Persistent):
    interface.implements(IHelloWorld)
    greeting = 'Hello'
    subject = 'world'

class MessageView(object):
    
    def message(self):
        return '%s %s!' % (self.context.greeting, self.context.subject)
 

class EditView(form.EditForm):
    form_fields = form.Fields(IHelloWorld)



I am using precompiled python 2.3 on windows xp, precompiled zope3
3.1.0final for python2.3.




Traceback (most recent call last):
  File "c:\python23\zopeskel\bin\runzope", line 48, in ?
    run()
  File "c:\python23\zopeskel\bin\runzope", line 44, in run
    main(["-C", CONFIG_FILE] + sys.argv[1:])
  File "C:\Python23\Lib\site-packages\zope\app\server\main.py", line 58, in
main
    setup(load_options(args))
  File "C:\Python23\Lib\site-packages\zope\app\server\main.py", line 169, in
setup
    zope.app.appsetup.config(options.site_definition)
  File "C:\Python23\Lib\site-packages\zope\app\appsetup\appsetup.py", line
52, in config
    context = xmlconfig.file(file, execute=execute)
  File "C:\Python23\Lib\site-packages\zope\configuration\xmlconfig.py", line
555, in file
    include(context, name, package)
  File "C:\Python23\Lib\site-packages\zope\configuration\xmlconfig.py", line
491, in include
    processxmlfile(f, context)
  File "C:\Python23\Lib\site-packages\zope\configuration\xmlconfig.py", line
346, in processxmlfile
    parser.parse(src)
  File "c:\python23\lib\xml\sax\expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "c:\python23\lib\xml\sax\xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "c:\python23\lib\xml\sax\expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "c:\python23\lib\xml\sax\expatreader.py", line 348, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "C:\Python23\Lib\site-packages\zope\configuration\xmlconfig.py", line
326, in endElementNS
    self.context.end()
  File "C:\Python23\Lib\site-packages\zope\configuration\config.py", line
554, in end
    self.stack.pop().finish()
  File "C:\Python23\Lib\site-packages\zope\configuration\config.py", line
702, in finish
    actions = self.handler(context, **args)
  File "C:\Python23\Lib\site-packages\zope\configuration\xmlconfig.py", line
491, in include
    processxmlfile(f, context)
  File "C:\Python23\Lib\site-packages\zope\configuration\xmlconfig.py", line
346, in processxmlfile
    parser.parse(src)
  File "c:\python23\lib\xml\sax\expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "c:\python23\lib\xml\sax\xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "c:\python23\lib\xml\sax\expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "c:\python23\lib\xml\sax\expatreader.py", line 348, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "C:\Python23\Lib\site-packages\zope\configuration\xmlconfig.py", line
326, in endElementNS
    self.context.end()
  File "C:\Python23\Lib\site-packages\zope\configuration\config.py", line
554, in end
    self.stack.pop().finish()
  File "C:\Python23\Lib\site-packages\zope\configuration\config.py", line
702, in finish
    actions = self.handler(context, **args)
  File "C:\Python23\Lib\site-packages\zope\configuration\xmlconfig.py", line
491, in include
    processxmlfile(f, context)
  File "C:\Python23\Lib\site-packages\zope\configuration\xmlconfig.py", line
346, in processxmlfile
    parser.parse(src)
  File "c:\python23\lib\xml\sax\expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "c:\python23\lib\xml\sax\xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "c:\python23\lib\xml\sax\expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "c:\python23\lib\xml\sax\expatreader.py", line 348, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "C:\Python23\Lib\site-packages\zope\configuration\xmlconfig.py", line
326, in endElementNS
    self.context.end()
  File "C:\Python23\Lib\site-packages\zope\configuration\config.py", line
554, in end
    self.stack.pop().finish()
  File "C:\Python23\Lib\site-packages\zope\configuration\config.py", line
701, in finish
    args = toargs(context, *self.argdata)
  File "C:\Python23\Lib\site-packages\zope\configuration\config.py", line
1393, in toargs
    args[str(name)] = field.fromUnicode(s)
  File "C:\Python23\Lib\site-packages\zope\configuration\fields.py", line
141, in fromUnicode
    raise schema.ValidationError(v)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File
"c:\python23\zopeskel\etc\site.zcml", line 7.2-7.55
    ZopeXMLConfigurationError: File
"c:\python23\zopeskel\etc\package-includes\hello-configure.zcml", line
1.0-1.27
    ZopeXMLConfigurationError: File
"c:\python23\zopeskel\lib\python\hello\configure.zcml", line 7.2-11.4
    ConfigurationError: ('Invalid value for', 'class', "Couldn't import
hello.hello, No module named formlib")






More information about the Zope3-users mailing list