Exception running GNU module "op25_grc.py" : AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback'

Dave Angel davea at davea.name
Sat Feb 16 00:24:45 EST 2013


On 02/15/2013 02:00 PM, matt.doolittle33 at gmail.com wrote:
> I am using using ubuntu 12.10 i am trying to run a python block, namely OP25, in GNU Radio Companion v3.6.3-35-g4435082f, which uses python version 2.7.3 for some reason although python3.2 is in the lib folder. I run the following trace command in terminal:
>
> ~$ python -m trace --count -C . op25_grc.py
>
> Here is the output with an error:
>
> Imported legacy fsk4
>   Using Volk machine: ssse3_32
>   Traceback (most recent call last):
>   File "/usr/lib/python2.7/runpy.py", line 162, in run_module_as_main
>   "_main__", fname, loader, pkg_name)
>   File "/usr/lib/python2.7/runpy.py", line 72, in run_code
>   exec code in run_globals
>   File "/usr/lib/python2.7/trace.py", line 819, in
>   main()
>   File "/usr/lib/python2.7/trace.py", line 807, in main
>   t.runctx(code, globs, globs)
>   File "/usr/lib/python2.7/trace.py", line 513, in runctx
>   exec cmd in globals, locals
>   File "op25_grc.py", line 493, in
>   tb = op25_grc()
>   File "op25_grc.py", line 231, in __init_
>   self.wxgui_fftsink2_0_0.set_callback(wxgui_fftsink2_0_0_callback)
>   File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", line 54, in getattr
>   return getattr(self._hb, name)
>   AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback'
>
> The code for "op25_grc.py":
>
> #!/usr/bin/env python
> ##################################################
> # Gnuradio Python Flow Graph
> # Title: Op25 Grc
> # Generated: Wed Feb 13 19:37:41 2013
> ##################################################
>
>    <snip>
>
> and the code from "hier_block2_.py":
>
> #
> # Copyright 2006,2007 Free Software Foundation, Inc.
> #
> # This file is part of GNU Radio
> #
> # GNU Radio is free software; you can redistribute it and/or modify
>
>    <snip>
>
>
> My goal is to fix the error: AttributeError: "'gr_hier_block2_sptr' object has no attribute 'set_callback'" so that the block "op25_grc.py" will run in GNU radio companion.
>
> i have been unable to find any sort of solution to this problem anywhere.  some have said its a version problem with GNUradio but as i posted above i have the latest version.
>
> Any help will be greatly appreciated.  Thank you very much!
>

I'm rather surprised somebody hasn't jumped in by now.  I thought your 
reworded query was quite well done.  One of the source files is pretty 
large, but it's not your code, so that perhaps cannot be helped.  I'm 
not sure why you included the code from hier_block2_.py, as I cannot see 
any reference to it.

I'm surprised at the comment in the first file that said the code was 
generated.  if it was generated by your efforts, perhaps there was 
something wrong with that.

I know nothing about this gnuradio thingie, and you didn't supply a 
website url.  I was wondering if the module is even intended to be run 
standalone, but I suppose the if __name__ == "__main__"  thing is a clue 
that it's supposed to.

I found the mixture of trace lines to confuse the stack trace immensely, 
since the exception doesn't occur in the last source line quoted. 
Somebody better than I had best jump in and help.

The error message referenced class gr_hier_block2_sptr, but I don't see 
where this is defined.  So I'm not sure how to tell whether it does or 
should have a set_callback method.

If nobody else jumps in, I'd suggest finding a forum that supports 
gnuradio, and ask there.


-- 
DaveA



More information about the Python-list mailing list