Powerline install - UndefinedError "result" not defined

39 views
Skip to first unread message

Jesse McDonnell

unread,
May 26, 2010, 6:10:58 PM5/26/10
to powerlin...@googlegroups.com, Jesse
To set the context for others meeting the same issue and following up on an earlier email with Jesse W. to resolve error message "TypeError: _new ()_ takes exactly 3 argument (2 given)" @ line 38 in main.py, per Jesse's suggestions I upgraded dbwrap and downgraded version Genshi to 0.4.4 [ sudo easy_install --record genshi044install Genshi-0.4.4-py2.5.egg
showed version 0.6 being uninstalled - maybe incomplete?)

The error now is

File "/var/lib/python-support/python2.5/genshi/template/eval.py", line 405, in undefined
    raise UndefinedError(key, owner=owner)
UndefinedError: "result" not defined

Any suggestions on what to do next and big thanks for the help so far!

Jesse

Full context below:


jesse@jesse-asus1000:~$ sudo python -m powerline.main /etc/powerline.conf[26/May/2010:17:09:31] ENGINE Listening for SIGHUP.
[26/May/2010:17:09:31] ENGINE Listening for SIGTERM.
[26/May/2010:17:09:31] ENGINE Listening for SIGUSR1.
[26/May/2010:17:09:31] ENGINE Bus STARTING
CherryPy Checker:
The Application mounted at '' has an empty config.

[26/May/2010:17:09:31] ENGINE Started monitor thread '_TimeoutMonitor'.
[26/May/2010:17:09:31] ENGINE Started monitor thread 'Autoreloader'.
[26/May/2010:17:09:31] ENGINE Serving on 127.0.0.1:8080
[26/May/2010:17:09:31] ENGINE Bus STARTED
[26/May/2010:17:10:20] HTTP
Request Headers:
  HOST: localhost:8080
 127.0.0.1 - - [26/May/2010:17:35:01] "GET / HTTP/1.1" 500 4225 "" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3"
[26/May/2010:17:35:03] HTTP
Request Headers:
  COOKIE: session_id=6d3206ba3bea53eb7aafd127e43eb630cd4cdb9d
  HOST: localhost:8080
  CACHE-CONTROL: max-age=0
  ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  ACCEPT-CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7
  USER-AGENT: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
  CONNECTION: keep-alive
  Remote-Addr: 127.0.0.1
  ACCEPT-LANGUAGE: en-us,en;q=0.5
  ACCEPT-ENCODING: gzip,deflate
  KEEP-ALIVE: 300
[26/May/2010:17:35:03] HTTP Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/CherryPy-3.1.2-py2.5.egg/cherrypy/_cprequest.py", line 606, in respond
    cherrypy.response.body = self.handler()
  File "/usr/lib/python2.5/site-packages/CherryPy-3.1.2-py2.5.egg/cherrypy/_cpdispatch.py", line 25, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/lib/python2.5/site-packages/powerline-0.2.4-py2.5.egg/powerline/web.py", line 62, in default
    return handler_func(**kwargs)
  File "/usr/lib/python2.5/site-packages/powerline-0.2.4-py2.5.egg/powerline/web.py", line 133, in wrapper
    return loader.load(template).generate(**body).render(method, **render_kwargs)
  File "/var/lib/python-support/python2.5/genshi/core.py", line 179, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "/var/lib/python-support/python2.5/genshi/output.py", line 60, in encode
    return _encode(u''.join(list(iterator)))
  File "/var/lib/python-support/python2.5/genshi/output.py", line 311, in __call__
    for kind, data, pos in stream:
  File "/var/lib/python-support/python2.5/genshi/output.py", line 592, in __call__
    for kind, data, pos in stream:
  File "/var/lib/python-support/python2.5/genshi/output.py", line 698, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/var/lib/python-support/python2.5/genshi/output.py", line 532, in __call__
    for ev in stream:
  File "/var/lib/python-support/python2.5/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/var/lib/python-support/python2.5/genshi/template/base.py", line 569, in _include
    for event in stream:
  File "/var/lib/python-support/python2.5/genshi/template/markup.py", line 278, in _match
    content = list(content)
  File "/var/lib/python-support/python2.5/genshi/template/base.py", line 569, in _include
    for event in stream:
  File "/var/lib/python-support/python2.5/genshi/template/markup.py", line 235, in _strip
    event = stream.next()
  File "/var/lib/python-support/python2.5/genshi/template/base.py", line 543, in _exec
    for event in stream:
  File "/var/lib/python-support/python2.5/genshi/template/base.py", line 496, in _eval
    for kind, data, pos in stream:
  File "/var/lib/python-support/python2.5/genshi/template/base.py", line 557, in _flatten
    **vars)
  File "/var/lib/python-support/python2.5/genshi/template/base.py", line 272, in _apply_directives
    stream = directives[0](iter(stream), directives[1:], ctxt, **vars)
  File "/var/lib/python-support/python2.5/genshi/template/directives.py", line 411, in __call__
    value = _eval_expr(self.expr, ctxt, **vars)
  File "/var/lib/python-support/python2.5/genshi/template/base.py", line 286, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/var/lib/python-support/python2.5/genshi/template/eval.py", line 180, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/usr/lib/python2.5/site-packages/powerline-0.2.4-py2.5.egg/powerline/templates/index.html", line 16, in <Expression u'result'>
    <py:choose test="" py:if="result">
  File "/var/lib/python-support/python2.5/genshi/template/eval.py", line 306, in lookup_name
    val = cls.undefined(name)
  File "/var/lib/python-support/python2.5/genshi/template/eval.py", line 405, in undefined
    raise UndefinedError(key, owner=owner)
UndefinedError: "result" not defined

127.0.0.1 - - [26/May/2010:17:35:03] "GET / HTTP/1.1" 500 4225 "" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3"



--
Jesse McDonnell

Jesse

unread,
May 27, 2010, 12:31:12 AM5/27/10
to Jesse McDonnell, powerlin...@googlegroups.com


2010/5/26 Jesse McDonnell <jessemc...@gmail.com>

Hmm. From what I've seen, only a more recent Genshi _should_ give that error. One quick and easy way to verify that 0.4.4 is installed is to run python -c 'import genshi; print genshi.__file__, genshi.__version__'

If it is the right version and you're still getting that error, let me know and I'll whip up a quick patch to solve the problem.

--
Jesse Weaver

clutch68rs

unread,
May 27, 2010, 12:47:18 AM5/27/10
to powerlin...@googlegroups.com
Hi Jesse,
It's been over a year since I messed with Powerline, but in my notes I'm
seeing some info from Jesse W. regarding this exact error:

"If you downgrade to Genshi 0.4, it'll work. I'll try to get a bugfix
release out soon."

This was in January 2009, and after following his instructions we had a
running Powerline system for testing. I'll see if I can dig up the
config I had on that server and get you an exact Genshi version #.

I'm glad to see this project is still active, we're very interested in
firing it up again

- Sean


On 5/26/2010 9:31 PM, Jesse wrote:
>
>
> 2010/5/26 Jesse McDonnell <jessemc...@gmail.com
> <mailto:jessemc...@gmail.com>>

> <http://127.0.0.1:8080>

> --
> You received this message because you are subscribed to the Google
> Groups "Powerline Discussion" group.
> To post to this group, send email to powerlin...@googlegroups.com.
> To unsubscribe from this group, send email to
> powerline-disc...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/powerline-discuss?hl=en.

Jesse McDonnell

unread,
May 27, 2010, 5:46:55 AM5/27/10
to Jesse, powerlin...@googlegroups.com
Jesse,

jesse@jesse-asus1000:~$ sudo python -c 'import genshi; print genshi._file_, genshi._version_'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute '_file_'
jesse@jesse-asus1000:~$

This is what I get, I took out the periods after genshi in case it might be just the way I was seeing the line and I get

jesse@jesse-asus1000:~$ sudo python -c 'import genshi; print genshi_file_, genshi_version_'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'genshi_file_' is not defined
jesse@jesse-asus1000:~$


JesseMc
--
Jesse McDonnell

Jesse McDonnell

unread,
May 27, 2010, 5:48:34 AM5/27/10
to powerlin...@googlegroups.com
That would be helpful. Thanks!

JesseMc

On Thu, May 27, 2010 at 12:47 AM, clutch68rs <clutc...@gmail.com> wrote:
Hi Jesse,
It's been over a year since I messed with Powerline, but in my notes I'm seeing some info from Jesse W. regarding this exact error:

"If you downgrade to Genshi 0.4, it'll work. I'll try to get a bugfix release out soon."

This was in January 2009, and after following his instructions we had a running Powerline system for testing. I'll see if I can dig up the config I had on that server and get you an exact Genshi version #.




--
Jesse McDonnell

Jesse McDonnell

unread,
May 27, 2010, 10:10:53 PM5/27/10
to Jesse, powerlin...@googlegroups.com


On Thu, May 27, 2010 at 12:31 AM, Jesse <piano...@gmail.com> wrote:

Hmm. From what I've seen, only a more recent Genshi _should_ give that error. One quick and easy way to verify that 0.4.4 is installed is to run python -c 'import genshi; print genshi.__file__, genshi.__version__'

If it is the right version and you're still getting that error, let me know and I'll whip up a quick patch to solve the problem.

Some more information: the contents of easy-install.pth say that Genshi-0.4.4 is installed. 

jesse@jesse-asus1000:~$ sudo more /usr/lib/python2.5/site-packages/easy-install.pth
import sys; sys.__plen = len(sys.path)
./powerline-0.2.4-py2.5.egg
./CherryPy-3.1.2-py2.5.egg
./dbwrap-0.2.5-py2.5.egg
./Genshi-0.4.4-py2.5.egg
import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,
'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)
jesse@jesse-asus1000:~$

JesseMc
--
Jesse McDonnell

Jesse

unread,
May 28, 2010, 12:52:15 PM5/28/10
to Jesse McDonnell, Powerline Discussion
Bringing this back to the list,

2010/5/28 Jesse McDonnell <jessemc...@gmail.com>


On Thu, May 27, 2010 at 11:51 PM, Jesse <piano...@gmail.com> wrote:
Ah, it looks like you might be running the command using only single underscores. Gmail's evil font most likely obscured it, but Python requires that you type genshi.__file__ (two underscores on each side) rather than genshi._file_ (one underscore).

Could you try it again?

Jesse,

Yep, I was running with the single underscore - I should have noticed that!

jesse@jesse-asus1000:~$ sudo python -c 'import genshi;print genshi.__file__,genshi.__version__'
/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/__init__.py 0.4.4
jesse@jesse-asus1000:~$

Please let me know the next step. Thanks!

Jessemc

Okay. The most interesting part of that message is the error; for some reason, that command imports Genshi 0.4.4 installed through easy-install, while, based on the filename in your original message, Powerline is using Genshi 0.5 or later installed through apt. Try sudo apt-get remove python-genshi

Sorry about all the fuss. All the more reason to get the new release out the door, to remove all of these obstacles (though it might not happen soon!)...


--
Jesse Weaver

Jesse McDonnell

unread,
May 28, 2010, 4:19:06 PM5/28/10
to Jesse, Powerline Discussion
Woohoo!! That was it - I uninstalled python-genshi-0.5.0-1 from my netbook and the Powerline web interface is working fine. That's as far as I'm going with the netbook install, next step is to get the library setup in place with pre-book clients on the computers etc, unlocking/de-kiosking the OPAC computer slightly so that patrons can do reservations on it.

Thanks a million for your help with this Jesse and for your work on Powerline. I'd be happy to do test installs of the new release whenever you have something ready, although it seems that in its current form Powerline does everything we really need.

Cheers!

JesseMc


--
Jesse McDonnell
Reply all
Reply to author
Forward
0 new messages